2 DEBIAN_FRONTEND: noninteractive
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
14 .docker: &docker_build
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
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"
29 - rm -f "$HOME/.docker/$CI_JOB_ID/" # cleanup the credentials
31 # That's Docker in Docker
34 docker_debian-7-amd64:
36 IMG_NAME: "debian-7-amd64"
39 docker_debian-8-amd64:
41 IMG_NAME: "debian-8-amd64"
44 docker_debian-9-amd64:
46 IMG_NAME: "debian-9-amd64"
49 docker_debian-testing-amd64:
51 IMG_NAME: "debian-testing-amd64"
56 IMG_NAME: "debian-7-i386"
61 IMG_NAME: "debian-8-i386"
66 IMG_NAME: "debian-9-i386"
69 docker_debian-testing-i386:
71 IMG_NAME: "debian-testing-i386"
74 docker_fedora-25-amd64:
76 IMG_NAME: "fedora-25-amd64"
79 docker_fedora-26-amd64:
81 IMG_NAME: "fedora-26-amd64"
84 docker_centos-7-amd64:
86 IMG_NAME: "centos-7-amd64"
89 docker_opensuse-42_3-amd64:
91 IMG_NAME: "opensuse-42.3-amd64"
94 docker_ubuntu-14_04-amd64:
96 IMG_NAME: "ubuntu-14.04-amd64"
99 docker_ubuntu-16_04-amd64:
101 IMG_NAME: "ubuntu-16.04-amd64"
104 .debian-7-i386: &debian-7-i386_env
105 image: registry.labs.nic.cz/labs/bird:debian-7-i386
111 .debian-8-i386: &debian-8-i386_env
112 image: registry.labs.nic.cz/labs/bird:debian-8-i386
118 .debian-9-i386: &debian-9-i386_env
119 image: registry.labs.nic.cz/labs/bird:debian-9-i386
125 .debian-testing-i386: &debian-testing-i386_env
126 image: registry.labs.nic.cz/labs/bird:debian-testing-i386
132 .debian-7-amd64: &debian-7-amd64_env
133 image: registry.labs.nic.cz/labs/bird:debian-7-amd64
139 .debian-8-amd64: &debian-8-amd64_env
140 image: registry.labs.nic.cz/labs/bird:debian-8-amd64
146 .debian-9-amd64: &debian-9-amd64_env
147 image: registry.labs.nic.cz/labs/bird:debian-9-amd64
153 .debian-testing-amd64: &debian-testing-amd64_env
154 image: registry.labs.nic.cz/labs/bird:debian-testing-amd64
160 .fedora-25-amd64: &fedora-25-amd64_env
161 image: registry.labs.nic.cz/labs/bird:fedora-25-amd64
167 .fedora-26-amd64: &fedora-26-amd64_env
168 image: registry.labs.nic.cz/labs/bird:fedora-26-amd64
174 .centos-7-amd64: ¢os-7-amd64_env
175 image: registry.labs.nic.cz/labs/bird:centos-7-amd64
181 .opensuse-42_3-amd64: &opensuse-42_3-amd64_env
182 image: registry.labs.nic.cz/labs/bird:opensuse-42.3-amd64
188 .ubuntu-14_04-amd64: &ubuntu-14_04-amd64_env
189 image: registry.labs.nic.cz/labs/bird:ubuntu-14.04-amd64
195 .ubuntu-16_04-amd64: &ubuntu-16_04-amd64_env
196 image: registry.labs.nic.cz/labs/bird:ubuntu-16.04-amd64
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
212 .freebsd-11-amd64: &freebsd-11-amd64_env
225 - ./configure CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS"
226 # Detect which make is available
228 - which gmake 2>/dev/null >/dev/null && MAKE=gmake
230 # Run tests if they are available
233 build-debian-7-amd64:
234 <<: *debian-7-amd64_env
237 build-debian-8-amd64:
238 <<: *debian-8-amd64_env
241 build-debian-9-amd64:
242 <<: *debian-9-amd64_env
245 build-debian-testing-amd64:
246 <<: *debian-testing-amd64_env
249 build-fedora-25-amd64:
250 <<: *fedora-25-amd64_env
253 build-fedora-26-amd64:
254 <<: *fedora-26-amd64_env
257 build-centos-7-amd64:
258 <<: *centos-7-amd64_env
261 build-opensuse-42_3-amd64:
262 <<: *opensuse-42_3-amd64_env
265 build-ubuntu-14_04-amd64:
266 <<: *ubuntu-14_04-amd64_env
269 build-ubuntu-16_04-amd64:
270 <<: *ubuntu-16_04-amd64_env
274 <<: *debian-7-i386_env
278 <<: *debian-8-i386_env
282 <<: *debian-9-i386_env
285 build-debian-testing-i386:
286 <<: *debian-testing-i386_env
289 build-freebsd-11-amd64:
290 <<: *freebsd-11-amd64_env
293 build-freebsd-11-i386:
294 <<: *freebsd-11-i386_env
310 - mv $DIR/bird $DIR/birdc netlab/common
314 needs: [build-birdlab]
319 - cd $TOOLS_DIR/netlab
320 - sudo ./runtest -m check $TEST_NAME