forked from pubnub/c-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
95 lines (71 loc) · 2.83 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
FROM ubuntu:20.04 AS cucumber_cpp
ARG DEBIAN_FRONTEND=noninteractive
WORKDIR /home
ENV GMOCK_VER=1.7.0
ENV CMAKE_CXX_COMPILER=/usr/bin/g++
RUN apt-get update
RUN apt-get install -y cmake g++ ruby ruby-dev git ninja-build libboost-all-dev gcovr libssl-dev gdb curl
RUN gem install bundler
ENV GMOCK_VER=1.7.0
ENV CMAKE_CXX_COMPILER=/usr/bin/g++
RUN git clone https://github.com/cucumber/cucumber-cpp.git
WORKDIR /home/cucumber-cpp
RUN bundle install
RUN git submodule init
RUN git submodule update
RUN cmake -E make_directory build
RUN cmake -E chdir build cmake --DCUKE_ENABLE_EXAMPLES=on ..
RUN cmake --build build
RUN cmake --build build --target test
FROM ubuntu:20.04 AS cgreen
ARG DEBIAN_FRONTEND=noninteractive
WORKDIR /home
ENV GMOCK_VER=1.7.0
ENV CMAKE_CXX_COMPILER=/usr/bin/g++
RUN apt-get update
RUN apt-get install -y cmake g++ ruby ruby-dev git ninja-build libboost-all-dev gcovr libssl-dev gdb curl
RUN git clone https://github.com/cgreen-devs/cgreen.git
RUN cd cgreen && git checkout 1.4.1 && make
FROM ubuntu:20.04
ARG DEBIAN_FRONTEND=noninteractive
WORKDIR /home
ENV GMOCK_VER=1.7.0
ENV CMAKE_CXX_COMPILER=/usr/bin/g++
RUN apt-get update
RUN apt-get install -y cmake g++ ruby ruby-dev git ninja-build libboost-all-dev gcovr libssl-dev gdb curl
RUN gem install cucumber
RUN apt-get install -y python3-pip
RUN pip install requests
COPY --from=cucumber_cpp /home/cucumber-cpp /home/cucumber-cpp/
COPY --from=cgreen /home/cgreen /home/cgreen/
COPY core /home/core/
COPY lib /home/lib/
RUN cd core && make generate_report
COPY posix /home/posix/
COPY cpp /home/cpp/
COPY openssl /home/openssl/
RUN cd cpp && make -f posix_openssl.mk openssl/pubnub_sync
ARG SUB_KEY
ARG PUB_KEY
ARG SEC_KEY
ARG MOCK_SERVER_DOCKER
ENV PAM_SUB_KEY=${SUB_KEY}
ENV PAM_PUB_KEY=${PUB_KEY}
ENV PAM_SEC_KEY=${SEC_KEY}
COPY sdk-specifications/features /home/features/
COPY features/step_definitions /home/features/step_definitions/
RUN if [ -z "$MOCK_SERVER_DOCKER" ]; then \
g++ -std=c++11 -g -o BoostSteps.o -c features/step_definitions/BoostSteps.cpp \
-Icucumber-cpp/include -Icucumber-cpp/build/src/ -Iposix -Icore -I. -Icpp \
-D PUBNUB_CRYPTO_API=1 -D PUBNUB_USE_SSL=0; \
else \
g++ -std=c++11 -g -o BoostSteps.o -c features/step_definitions/BoostSteps.cpp \
-Icucumber-cpp/include -Icucumber-cpp/build/src/ -Iposix -Icore -I. -Icpp \
-D PUBNUB_CRYPTO_API=1 -D PUBNUB_USE_SSL=0 -D MOCK_SERVER_DOCKER; \
fi
RUN g++ -o steps BoostSteps.o cpp/pubnub_sync.a cucumber-cpp/build/src/libcucumber-cpp.a \
-Lboost -lboost_unit_test_framework -lpthread -lboost_regex \
-lboost_thread -lboost_program_options -lboost_filesystem \
-lssl -lcrypto -D PUBNUB_USE_SSL=0
COPY run_contract_tests.py .
ENTRYPOINT [ "python3", "/home/run_contract_tests.py", "/home/features/access/revoke-token.feature", "mock_server"]