]> git.ipfire.org Git - thirdparty/bird.git/blob - .gitlab-ci.yml
CI: Update new netlab location
[thirdparty/bird.git] / .gitlab-ci.yml
1 variables:
2 DEBIAN_FRONTEND: noninteractive
3 LC_ALL: C
4 GIT_STRATEGY: fetch
5 DOCKER_CMD: docker --config="$HOME/.docker/$CI_JOB_ID/"
6 IMG_BASE: registry.labs.nic.cz/labs/bird
7 TOOLS_DIR: /var/lib/gitlab-runner/bird-tools
8
9 stages:
10 - image
11 - build
12 - test
13
14 .docker: &docker_build
15 stage: image
16 allow_failure: true
17 script:
18 - $DOCKER_CMD login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.labs.nic.cz
19 # Make sure we refresh the base image if it updates (eg. security updates, etc)
20 # If we do just the build, cache is always reused and the freshness of the
21 # base image is never checked. However, pull always asks and updates the
22 # image only if it changed ‒ therefore, the cache is used unless there's a
23 # change.
24 - $DOCKER_CMD pull `sed -ne 's/^FROM //p' "misc/docker/$IMG_NAME/Dockerfile"`
25 - $DOCKER_CMD build -t "bird:$IMG_NAME" "misc/docker/$IMG_NAME"
26 - $DOCKER_CMD tag "bird:$IMG_NAME" "$IMG_BASE:$IMG_NAME"
27 - $DOCKER_CMD push "$IMG_BASE:$IMG_NAME"
28 after_script:
29 - rm -f "$HOME/.docker/$CI_JOB_ID/" # cleanup the credentials
30 tags:
31 # That's Docker in Docker
32 - dind
33
34 docker_debian-7-amd64:
35 variables:
36 IMG_NAME: "debian-7-amd64"
37 <<: *docker_build
38
39 docker_debian-8-amd64:
40 variables:
41 IMG_NAME: "debian-8-amd64"
42 <<: *docker_build
43
44 docker_debian-9-amd64:
45 variables:
46 IMG_NAME: "debian-9-amd64"
47 <<: *docker_build
48
49 docker_debian-testing-amd64:
50 variables:
51 IMG_NAME: "debian-testing-amd64"
52 <<: *docker_build
53
54 docker_debian-7-i386:
55 variables:
56 IMG_NAME: "debian-7-i386"
57 <<: *docker_build
58
59 docker_debian-8-i386:
60 variables:
61 IMG_NAME: "debian-8-i386"
62 <<: *docker_build
63
64 docker_debian-9-i386:
65 variables:
66 IMG_NAME: "debian-9-i386"
67 <<: *docker_build
68
69 docker_debian-testing-i386:
70 variables:
71 IMG_NAME: "debian-testing-i386"
72 <<: *docker_build
73
74 docker_fedora-25-amd64:
75 variables:
76 IMG_NAME: "fedora-25-amd64"
77 <<: *docker_build
78
79 docker_fedora-26-amd64:
80 variables:
81 IMG_NAME: "fedora-26-amd64"
82 <<: *docker_build
83
84 docker_centos-7-amd64:
85 variables:
86 IMG_NAME: "centos-7-amd64"
87 <<: *docker_build
88
89 docker_opensuse-42_3-amd64:
90 variables:
91 IMG_NAME: "opensuse-42.3-amd64"
92 <<: *docker_build
93
94 docker_ubuntu-14_04-amd64:
95 variables:
96 IMG_NAME: "ubuntu-14.04-amd64"
97 <<: *docker_build
98
99 docker_ubuntu-16_04-amd64:
100 variables:
101 IMG_NAME: "ubuntu-16.04-amd64"
102 <<: *docker_build
103
104 .debian-7-i386: &debian-7-i386_env
105 image: registry.labs.nic.cz/labs/bird:debian-7-i386
106 tags:
107 - docker
108 - linux
109 - amd64
110
111 .debian-8-i386: &debian-8-i386_env
112 image: registry.labs.nic.cz/labs/bird:debian-8-i386
113 tags:
114 - docker
115 - linux
116 - amd64
117
118 .debian-9-i386: &debian-9-i386_env
119 image: registry.labs.nic.cz/labs/bird:debian-9-i386
120 tags:
121 - docker
122 - linux
123 - amd64
124
125 .debian-testing-i386: &debian-testing-i386_env
126 image: registry.labs.nic.cz/labs/bird:debian-testing-i386
127 tags:
128 - docker
129 - linux
130 - amd64
131
132 .debian-7-amd64: &debian-7-amd64_env
133 image: registry.labs.nic.cz/labs/bird:debian-7-amd64
134 tags:
135 - docker
136 - linux
137 - amd64
138
139 .debian-8-amd64: &debian-8-amd64_env
140 image: registry.labs.nic.cz/labs/bird:debian-8-amd64
141 tags:
142 - docker
143 - linux
144 - amd64
145
146 .debian-9-amd64: &debian-9-amd64_env
147 image: registry.labs.nic.cz/labs/bird:debian-9-amd64
148 tags:
149 - docker
150 - linux
151 - amd64
152
153 .debian-testing-amd64: &debian-testing-amd64_env
154 image: registry.labs.nic.cz/labs/bird:debian-testing-amd64
155 tags:
156 - docker
157 - linux
158 - amd64
159
160 .fedora-25-amd64: &fedora-25-amd64_env
161 image: registry.labs.nic.cz/labs/bird:fedora-25-amd64
162 tags:
163 - docker
164 - linux
165 - amd64
166
167 .fedora-26-amd64: &fedora-26-amd64_env
168 image: registry.labs.nic.cz/labs/bird:fedora-26-amd64
169 tags:
170 - docker
171 - linux
172 - amd64
173
174 .centos-7-amd64: &centos-7-amd64_env
175 image: registry.labs.nic.cz/labs/bird:centos-7-amd64
176 tags:
177 - docker
178 - linux
179 - amd64
180
181 .opensuse-42_3-amd64: &opensuse-42_3-amd64_env
182 image: registry.labs.nic.cz/labs/bird:opensuse-42.3-amd64
183 tags:
184 - docker
185 - linux
186 - amd64
187
188 .ubuntu-14_04-amd64: &ubuntu-14_04-amd64_env
189 image: registry.labs.nic.cz/labs/bird:ubuntu-14.04-amd64
190 tags:
191 - docker
192 - linux
193 - amd64
194
195 .ubuntu-16_04-amd64: &ubuntu-16_04-amd64_env
196 image: registry.labs.nic.cz/labs/bird:ubuntu-16.04-amd64
197 tags:
198 - docker
199 - linux
200 - amd64
201
202 # TODO We want to copy these BSDs to our own virtual machines, to make sure someone doesn't update them by accident.
203 .freebsd-11-i386: &freebsd-11-i386_env
204 tags:
205 - freebsd
206 - i386
207 #only:
208 #- master
209 #- triggers
210 #- tags
211
212 .freebsd-11-amd64: &freebsd-11-amd64_env
213 tags:
214 - freebsd
215 - amd64
216 #only:
217 #- master
218 #- triggers
219 #- tags
220
221 .build: &build_job
222 stage: build
223 script:
224 - autoreconf
225 - ./configure CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS"
226 # Detect which make is available
227 - MAKE=make
228 - which gmake 2>/dev/null >/dev/null && MAKE=gmake
229 - $MAKE
230 # Run tests if they are available
231 - $MAKE check
232
233 build-debian-7-amd64:
234 <<: *debian-7-amd64_env
235 <<: *build_job
236
237 build-debian-8-amd64:
238 <<: *debian-8-amd64_env
239 <<: *build_job
240
241 build-debian-9-amd64:
242 <<: *debian-9-amd64_env
243 <<: *build_job
244
245 build-debian-testing-amd64:
246 <<: *debian-testing-amd64_env
247 <<: *build_job
248
249 build-fedora-25-amd64:
250 <<: *fedora-25-amd64_env
251 <<: *build_job
252
253 build-fedora-26-amd64:
254 <<: *fedora-26-amd64_env
255 <<: *build_job
256
257 build-centos-7-amd64:
258 <<: *centos-7-amd64_env
259 <<: *build_job
260
261 build-opensuse-42_3-amd64:
262 <<: *opensuse-42_3-amd64_env
263 <<: *build_job
264
265 build-ubuntu-14_04-amd64:
266 <<: *ubuntu-14_04-amd64_env
267 <<: *build_job
268
269 build-ubuntu-16_04-amd64:
270 <<: *ubuntu-16_04-amd64_env
271 <<: *build_job
272
273 build-debian-7-i386:
274 <<: *debian-7-i386_env
275 <<: *build_job
276
277 build-debian-8-i386:
278 <<: *debian-8-i386_env
279 <<: *build_job
280
281 build-debian-9-i386:
282 <<: *debian-9-i386_env
283 <<: *build_job
284
285 build-debian-testing-i386:
286 <<: *debian-testing-i386_env
287 <<: *build_job
288
289 build-freebsd-11-amd64:
290 <<: *freebsd-11-amd64_env
291 <<: *build_job
292
293 build-freebsd-11-i386:
294 <<: *freebsd-11-i386_env
295 <<: *build_job
296
297 build-birdlab:
298 stage: build
299 tags:
300 - birdlab
301 - amd64
302 script:
303 - DIR=$(pwd)
304 - autoreconf
305 - ./configure
306 - make
307 - cd $TOOLS_DIR
308 - sudo git clean -fx
309 - git pull --ff-only
310 - mv $DIR/bird $DIR/birdc netlab/common
311
312 .test: &test_job
313 stage: test
314 needs: [build-birdlab]
315 tags:
316 - birdlab
317 - amd64
318 script:
319 - cd $TOOLS_DIR/netlab
320 - sudo ./runtest -m check $TEST_NAME
321
322 test-ospf:
323 variables:
324 TEST_NAME: cf-ospf
325 <<: *test_job