-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
156 lines (136 loc) · 5.77 KB
/
.gitlab-ci.yml
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
image: docker:24.0.2
services:
- docker:24.0.2
variables:
CPPCHECK_VERSION_TAG: '2.8'
DOXYGEN_VERSION_TAG: '1.9.4-4'
DOXYGEN_AWESOME_CSS_VERSION_TAG: '1.6.0'
CLANG_TOOLS_VERSION_TAG: '14.0.6'
CLANG_HTML_VERSION_TAG: '1.6.1'
GCOVR_VERSION_TAG: '6.0'
LCOV_VERSION_TAG: '1.15.5a0'
IKOS_VERSION_TAG: '3.3'
CONAN_VERSION_TAG: '2.2.3'
DOCKER_BUILDKIT: 1
stages:
- prebuild
- build
- deploy
# Base images are published early, in order for the next stages to pull them from Docker Hub
# without needing to pass them around and without having to edit all dockerfiles, while making
# sure that only the latest base is used every time
build-bases:
stage: prebuild
script:
- export BASE_BUILD_DATE=$(date -u '+%Y%m%dZ%H-%M-%S')
- docker build . -f base/Dockerfile --build-arg CONAN_VERSION_TAG=$CONAN_VERSION_TAG --target build-base -t $CI_REGISTRY/$CI_REGISTRY_USER/build-base:$BASE_BUILD_DATE -t $CI_REGISTRY/$CI_REGISTRY_USER/build-base:latest
- docker build . -f base/Dockerfile --build-arg CONAN_VERSION_TAG=$CONAN_VERSION_TAG --target deploy-base -t $CI_REGISTRY/$CI_REGISTRY_USER/deploy-base:$BASE_BUILD_DATE -t $CI_REGISTRY/$CI_REGISTRY_USER/deploy-base:latest
- docker save -o build-base.tar $CI_REGISTRY/$CI_REGISTRY_USER/build-base
- docker save -o deploy-base.tar $CI_REGISTRY/$CI_REGISTRY_USER/deploy-base
artifacts:
paths:
- ./build-base.tar
- ./deploy-base.tar
only:
refs:
- master
deploy-bases:
stage: prebuild
dependencies:
- build-bases
needs:
- build-bases
script:
- find . -type f -name "*.tar" -exec docker load -i {} \;
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker push -a $CI_REGISTRY/$CI_REGISTRY_USER/build-base
- docker push -a $CI_REGISTRY/$CI_REGISTRY_USER/deploy-base
only:
refs:
- master
cppcheck:
stage: build
dependencies:
- build-bases
script:
- docker build . -f cppcheck/Dockerfile --build-arg CPPCHECK_VERSION_TAG=$CPPCHECK_VERSION_TAG -t $CI_REGISTRY/$CI_REGISTRY_USER/cppcheck:$CPPCHECK_VERSION_TAG
- docker save -o cppcheck:$CPPCHECK_VERSION_TAG.tar $CI_REGISTRY/$CI_REGISTRY_USER/cppcheck:$CPPCHECK_VERSION_TAG
artifacts:
paths:
- ./cppcheck:$CPPCHECK_VERSION_TAG.tar
doxygen:
stage: build
dependencies:
- build-bases
script:
- docker build . -f doxygen/Dockerfile --build-arg DOXYGEN_VERSION_TAG=$DOXYGEN_VERSION_TAG --build-arg DOXYGEN_AWESOME_CSS_VERSION_TAG=$DOXYGEN_AWESOME_CSS_VERSION_TAG -t $CI_REGISTRY/$CI_REGISTRY_USER/doxygen:$DOXYGEN_VERSION_TAG-awesomecss-$DOXYGEN_AWESOME_CSS_VERSION_TAG
- docker save -o doxygen:$DOXYGEN_VERSION_TAG-awesomecss-$DOXYGEN_AWESOME_CSS_VERSION_TAG.tar $CI_REGISTRY/$CI_REGISTRY_USER/doxygen:$DOXYGEN_VERSION_TAG-awesomecss-$DOXYGEN_AWESOME_CSS_VERSION_TAG
artifacts:
paths:
- ./doxygen:$DOXYGEN_VERSION_TAG-awesomecss-$DOXYGEN_AWESOME_CSS_VERSION_TAG.tar
clang-tools:
stage: build
services:
- docker:24.0.2-dind
timeout: 6 hours
dependencies:
- build-bases
script:
- docker build . -f clang-tools/Dockerfile --network host --build-arg CLANG_TOOLS_VERSION_TAG=$CLANG_TOOLS_VERSION_TAG --build-arg CLANG_HTML_VERSION_TAG=$CLANG_HTML_VERSION_TAG -t $CI_REGISTRY/$CI_REGISTRY_USER/clang-tools:$CLANG_TOOLS_VERSION_TAG-html-$CLANG_HTML_VERSION_TAG
- docker save -o clang-tools:$CLANG_TOOLS_VERSION_TAG-html-$CLANG_HTML_VERSION_TAG.tar $CI_REGISTRY/$CI_REGISTRY_USER/clang-tools:$CLANG_TOOLS_VERSION_TAG-html-$CLANG_HTML_VERSION_TAG
artifacts:
paths:
- ./clang-tools:$CLANG_TOOLS_VERSION_TAG-html-$CLANG_HTML_VERSION_TAG.tar
coverage:
stage: build
dependencies:
- build-bases
script:
- docker build . -f coverage/Dockerfile --build-arg GCOVR_VERSION_TAG=$GCOVR_VERSION_TAG --build-arg LCOV_VERSION_TAG=$LCOV_VERSION_TAG -t $CI_REGISTRY/$CI_REGISTRY_USER/coverage:gcovr-$GCOVR_VERSION_TAG-lcov-$LCOV_VERSION_TAG
- docker save -o coverage:gcovr-$GCOVR_VERSION_TAG-lcov-$LCOV_VERSION_TAG.tar $CI_REGISTRY/$CI_REGISTRY_USER/coverage:gcovr-$GCOVR_VERSION_TAG-lcov-$LCOV_VERSION_TAG
artifacts:
paths:
- ./coverage:gcovr-$GCOVR_VERSION_TAG-lcov-$LCOV_VERSION_TAG.tar
build-arm:
stage: build
dependencies:
- build-bases
script:
- export ARM_BUILD_DATE=$(date -u '+%Y%m%dZ%H-%M-%S')
- docker build . -f arm/Dockerfile -t $CI_REGISTRY/$CI_REGISTRY_USER/build-arm:$ARM_BUILD_DATE -t $CI_REGISTRY/$CI_REGISTRY_USER/build-arm:latest
- docker save -o build-arm.tar $CI_REGISTRY/$CI_REGISTRY_USER/build-arm
artifacts:
paths:
- ./build-arm.tar
ikos:
stage: build
dependencies:
- build-bases
script:
- docker build . -f ikos/Dockerfile --network host --build-arg IKOS_VERSION_TAG=$IKOS_VERSION_TAG -t $CI_REGISTRY/$CI_REGISTRY_USER/ikos:$IKOS_VERSION_TAG
- docker save -o ikos:$IKOS_VERSION_TAG.tar $CI_REGISTRY/$CI_REGISTRY_USER/ikos:$IKOS_VERSION_TAG
artifacts:
paths:
- ./ikos:$IKOS_VERSION_TAG.tar
deploy-all:
stage: deploy
dependencies:
- cppcheck
- doxygen
- clang-tools
- coverage
- build-arm
- ikos
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script:
- find . -type f -name "*.tar" -exec docker load -i {} \;
- docker push $CI_REGISTRY/$CI_REGISTRY_USER/cppcheck:$CPPCHECK_VERSION_TAG
- docker push $CI_REGISTRY/$CI_REGISTRY_USER/clang-tools:$CLANG_TOOLS_VERSION_TAG-html-$CLANG_HTML_VERSION_TAG
- docker push $CI_REGISTRY/$CI_REGISTRY_USER/doxygen:$DOXYGEN_VERSION_TAG-awesomecss-$DOXYGEN_AWESOME_CSS_VERSION_TAG
- docker push $CI_REGISTRY/$CI_REGISTRY_USER/coverage:gcovr-$GCOVR_VERSION_TAG-lcov-$LCOV_VERSION_TAG
- docker push $CI_REGISTRY/$CI_REGISTRY_USER/build-arm
- docker push $CI_REGISTRY/$CI_REGISTRY_USER/ikos:$IKOS_VERSION_TAG
only:
refs:
- master