]>
Commit | Line | Data |
---|---|---|
5c4dfe0c MV |
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 | |
faa43a75 | 7 | TOOLS_DIR: /var/lib/gitlab-runner/bird-tools |
5c4dfe0c MV |
8 | |
9 | stages: | |
10 | - image | |
11 | - build | |
faa43a75 | 12 | - test |
5c4dfe0c MV |
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 | ||
5c4dfe0c MV |
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 | ||
5c4dfe0c | 104 | |
0adfa0ec | 105 | .build: &build-base |
5c4dfe0c MV |
106 | stage: build |
107 | script: | |
108 | - autoreconf | |
4ff15a75 | 109 | - ./configure CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" |
5c4dfe0c MV |
110 | # Detect which make is available |
111 | - MAKE=make | |
112 | - which gmake 2>/dev/null >/dev/null && MAKE=gmake | |
113 | - $MAKE | |
cb5df823 OZ |
114 | # Run tests if they are available |
115 | - $MAKE check | |
5c4dfe0c | 116 | |
0adfa0ec OZ |
117 | .build-linux: &build-linux |
118 | <<: *build-base | |
119 | tags: | |
120 | - docker | |
121 | - linux | |
122 | - amd64 | |
123 | ||
5c4dfe0c | 124 | build-debian-7-amd64: |
0adfa0ec OZ |
125 | <<: *build-linux |
126 | image: registry.labs.nic.cz/labs/bird:debian-7-amd64 | |
127 | ||
128 | build-debian-7-i386: | |
129 | <<: *build-linux | |
130 | image: registry.labs.nic.cz/labs/bird:debian-7-i386 | |
5c4dfe0c MV |
131 | |
132 | build-debian-8-amd64: | |
0adfa0ec OZ |
133 | <<: *build-linux |
134 | image: registry.labs.nic.cz/labs/bird:debian-8-amd64 | |
135 | ||
136 | build-debian-8-i386: | |
137 | <<: *build-linux | |
138 | image: registry.labs.nic.cz/labs/bird:debian-8-i386 | |
5c4dfe0c MV |
139 | |
140 | build-debian-9-amd64: | |
0adfa0ec OZ |
141 | <<: *build-linux |
142 | image: registry.labs.nic.cz/labs/bird:debian-9-amd64 | |
143 | ||
144 | build-debian-9-i386: | |
145 | <<: *build-linux | |
146 | image: registry.labs.nic.cz/labs/bird:debian-9-i386 | |
5c4dfe0c MV |
147 | |
148 | build-debian-testing-amd64: | |
0adfa0ec OZ |
149 | <<: *build-linux |
150 | image: registry.labs.nic.cz/labs/bird:debian-testing-amd64 | |
151 | ||
152 | build-debian-testing-i386: | |
153 | <<: *build-linux | |
154 | image: registry.labs.nic.cz/labs/bird:debian-testing-i386 | |
5c4dfe0c | 155 | |
5c4dfe0c | 156 | build-fedora-25-amd64: |
0adfa0ec OZ |
157 | <<: *build-linux |
158 | image: registry.labs.nic.cz/labs/bird:fedora-25-amd64 | |
5c4dfe0c | 159 | |
5c4dfe0c | 160 | build-fedora-26-amd64: |
0adfa0ec OZ |
161 | <<: *build-linux |
162 | image: registry.labs.nic.cz/labs/bird:fedora-26-amd64 | |
5c4dfe0c | 163 | |
5c4dfe0c | 164 | build-centos-7-amd64: |
0adfa0ec OZ |
165 | <<: *build-linux |
166 | image: registry.labs.nic.cz/labs/bird:centos-7-amd64 | |
5c4dfe0c | 167 | |
5c4dfe0c | 168 | build-opensuse-42_3-amd64: |
0adfa0ec OZ |
169 | <<: *build-linux |
170 | image: registry.labs.nic.cz/labs/bird:opensuse-42.3-amd64 | |
5c4dfe0c | 171 | |
5c4dfe0c | 172 | build-ubuntu-14_04-amd64: |
0adfa0ec OZ |
173 | <<: *build-linux |
174 | image: registry.labs.nic.cz/labs/bird:ubuntu-14.04-amd64 | |
5c4dfe0c | 175 | |
5c4dfe0c | 176 | build-ubuntu-16_04-amd64: |
0adfa0ec OZ |
177 | <<: *build-linux |
178 | image: registry.labs.nic.cz/labs/bird:ubuntu-16.04-amd64 | |
5c4dfe0c | 179 | |
5c4dfe0c | 180 | build-freebsd-11-amd64: |
0adfa0ec OZ |
181 | <<: *build-base |
182 | tags: | |
183 | - freebsd | |
184 | - amd64 | |
5c4dfe0c | 185 | |
5c4dfe0c | 186 | build-freebsd-11-i386: |
0adfa0ec OZ |
187 | <<: *build-base |
188 | tags: | |
189 | - freebsd | |
190 | - i386 | |
5176455f OZ |
191 | |
192 | build-birdlab: | |
faa43a75 | 193 | stage: build |
5176455f | 194 | tags: |
faa43a75 OZ |
195 | - birdlab |
196 | - amd64 | |
197 | script: | |
198 | - DIR=$(pwd) | |
199 | - autoreconf | |
200 | - ./configure | |
201 | - make | |
202 | - cd $TOOLS_DIR | |
203 | - sudo git clean -fx | |
204 | - git pull --ff-only | |
6a314d26 | 205 | - mv $DIR/bird $DIR/birdc netlab/common |
faa43a75 | 206 | |
0adfa0ec OZ |
207 | |
208 | .test: &test-base | |
faa43a75 | 209 | stage: test |
148bd9ee | 210 | needs: [build-birdlab] |
faa43a75 OZ |
211 | tags: |
212 | - birdlab | |
213 | - amd64 | |
214 | script: | |
6a314d26 | 215 | - cd $TOOLS_DIR/netlab |
148bd9ee OZ |
216 | - sudo ./runtest -m check $TEST_NAME |
217 | ||
218 | test-ospf: | |
0adfa0ec | 219 | <<: *test-base |
148bd9ee OZ |
220 | variables: |
221 | TEST_NAME: cf-ospf |