-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.gitlab-ci.yml
527 lines (469 loc) · 11.3 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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
---
stages:
- source test
- build
- vendor upload
- upload
variables:
CLOUD_IMAGE_BUILD_ID: ${CI_PROJECT_NAMESPACE}-${CI_COMMIT_REF_SLUG}
GIT_DEPTH: "1"
before_script:
- apt-get update
- apt-get install --no-install-recommends -y python3-libcloud python3-marshmallow python3-yaml qemu-utils
- |
if [ "$CI_DISPOSABLE_ENVIRONMENT" ]; then
# Workaround unsupported SEEK_HOLE in overlayfs (Docker default)
mount -t tmpfs none /tmp
fi
test flake8:
stage: source test
image: debian:buster
script:
- >
apt-get install --no-install-recommends -y
python3-flake8
- python3 -m flake8
test mypy:
stage: source test
image: debian:bullseye
script:
- >
apt-get install --no-install-recommends -y
mypy
- mypy src
allow_failure: true
test package:
stage: source test
image: debian:buster
script:
- apt-get build-dep -y ./
- >
apt-get install --no-install-recommends -y
lintian
- DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -us -uc
- lintian ../*.changes
test pytest:
stage: source test
image: debian:buster
script:
- >
apt-get install --no-install-recommends -y
python3-pytest python3-pytest-cov
- >
PYTHONPATH=src
py.test-3
-vrxXs
--color=yes
--cov=src --cov-report=term --cov-report=html:coverage
--junit-xml=junit.xml
tests
artifacts:
paths:
- coverage/
reports:
junit: junit.xml
test pytest latest:
stage: source test
image: python:slim
before_script:
- pip install -e .
script:
- python3 ./setup.py pytest
.build:
stage: build
image: debian:buster
script:
- >
apt-get install --no-install-recommends -y
binfmt-support ca-certificates debsums dosfstools fai-server fai-setup-storage make python3-pytest qemu-user-static qemu-utils sudo udev
- |
if [ "$CI_DISPOSABLE_ENVIRONMENT" ]; then
# Some of our build environments run with SELinux enabled, make sure it is detected by all the tools
if [ -d /sys/fs/selinux ]; then mount -t selinuxfs none /sys/fs/selinux; mkdir -p /etc/selinux; touch /etc/selinux/config; fi
fi
- >
echo
debian-cloud-images build
--build-id ${CLOUD_IMAGE_BUILD_ID}
--build-type dev
--version ${CI_PIPELINE_IID}
${CLOUD_RELEASE} ${CLOUD_VENDOR} ${CLOUD_ARCH}
- >
./bin/debian-cloud-images build
--build-id ${CLOUD_IMAGE_BUILD_ID}
--build-type dev
${CLOUD_RELEASE} ${CLOUD_VENDOR} ${CLOUD_ARCH}
- 'xz -vk5T0 *.tar'
artifacts:
name: debian-${CLOUD_RELEASE}-${CLOUD_VENDOR}-${CLOUD_ARCH}
expire_in: 7 days
paths:
- '*.build.json'
- '*.info'
- '*.tar.xz'
reports:
junit: '*.build.junit.xml'
allow_failure: true
####
# Builds for developer uploads pushes
#
# Builds are run if
# - it is requested by setting $BUILD_AZURE, $BUILD_EC2, $BUILD_GCE, $BUILD_GENERIC or $BUILD_NOCLOUD or
# - the manual jobs are started.
####
.azure build:
extends: .build
rules:
- if: '$CI_MERGE_REQUEST_ID == null && $BUILD_AZURE'
when: on_success
- if: '$CI_MERGE_REQUEST_ID == null'
when: manual
azure stretch build:
extends: .azure build
variables:
CLOUD_ARCH: amd64
CLOUD_RELEASE: stretch
CLOUD_VENDOR: azure
azure stretch-backports build:
extends: .azure build
variables:
CLOUD_ARCH: amd64
CLOUD_RELEASE: stretch-backports
CLOUD_VENDOR: azure
azure buster build:
extends: .azure build
variables:
CLOUD_ARCH: amd64
CLOUD_RELEASE: buster
CLOUD_VENDOR: azure
azure buster-backports build:
extends: .azure build
variables:
CLOUD_ARCH: amd64
CLOUD_RELEASE: buster-backports
CLOUD_VENDOR: azure
azure bullseye build:
extends: .azure build
variables:
CLOUD_ARCH: amd64
CLOUD_RELEASE: bullseye
CLOUD_VENDOR: azure
azure sid build:
extends: .azure build
variables:
CLOUD_ARCH: amd64
CLOUD_RELEASE: sid
CLOUD_VENDOR: azure
.ec2 build:
extends: .build
rules:
- if: '$CI_MERGE_REQUEST_ID == null && $BUILD_EC2'
when: on_success
- if: '$CI_MERGE_REQUEST_ID == null'
when: manual
ec2 stretch amd64 build:
extends: .ec2 build
variables:
CLOUD_ARCH: amd64
CLOUD_RELEASE: stretch
CLOUD_VENDOR: ec2
ec2 buster amd64 build:
extends: .ec2 build
variables:
CLOUD_ARCH: amd64
CLOUD_RELEASE: buster
CLOUD_VENDOR: ec2
ec2 bullseye amd64 build:
extends: .ec2 build
variables:
CLOUD_ARCH: amd64
CLOUD_RELEASE: bullseye
CLOUD_VENDOR: ec2
ec2 sid amd64 build:
extends: .ec2 build
variables:
CLOUD_ARCH: amd64
CLOUD_RELEASE: sid
CLOUD_VENDOR: ec2
ec2 stretch arm64 build:
extends: .ec2 build
variables:
CLOUD_ARCH: arm64
CLOUD_RELEASE: stretch
CLOUD_VENDOR: ec2
ec2 buster arm64 build:
extends: .ec2 build
variables:
CLOUD_ARCH: arm64
CLOUD_RELEASE: buster
CLOUD_VENDOR: ec2
ec2 bullseye arm64 build:
extends: .ec2 build
variables:
CLOUD_ARCH: arm64
CLOUD_RELEASE: bullseye
CLOUD_VENDOR: ec2
ec2 sid arm64 build:
extends: .ec2 build
variables:
CLOUD_ARCH: arm64
CLOUD_RELEASE: sid
CLOUD_VENDOR: ec2
.gce build:
extends: .build
rules:
- if: '$CI_MERGE_REQUEST_ID == null && $BUILD_GCE'
when: on_success
- if: '$CI_MERGE_REQUEST_ID == null'
when: manual
gce stretch build:
extends: .gce build
variables:
CLOUD_ARCH: amd64
CLOUD_RELEASE: stretch
CLOUD_VENDOR: gce
gce buster build:
extends: .gce build
variables:
CLOUD_ARCH: amd64
CLOUD_RELEASE: buster
CLOUD_VENDOR: gce
gce bullseye build:
extends: .gce build
variables:
CLOUD_ARCH: amd64
CLOUD_RELEASE: bullseye
CLOUD_VENDOR: gce
gce sid build:
extends: .gce build
variables:
CLOUD_ARCH: amd64
CLOUD_RELEASE: sid
CLOUD_VENDOR: gce
.generic build:
extends: .build
rules:
- if: '$CI_MERGE_REQUEST_ID == null && $BUILD_GENERIC'
when: on_success
- if: '$CI_MERGE_REQUEST_ID == null'
when: manual
generic buster amd64 build:
extends: .generic build
variables:
CLOUD_ARCH: amd64
CLOUD_RELEASE: buster
CLOUD_VENDOR: generic
generic bullseye amd64 build:
extends: .generic build
variables:
CLOUD_ARCH: amd64
CLOUD_RELEASE: bullseye
CLOUD_VENDOR: generic
generic sid amd64 build:
extends: .generic build
variables:
CLOUD_ARCH: amd64
CLOUD_RELEASE: sid
CLOUD_VENDOR: generic
generic buster arm64 build:
extends: .generic build
variables:
CLOUD_ARCH: arm64
CLOUD_RELEASE: buster
CLOUD_VENDOR: generic
generic bullseye arm64 build:
extends: .generic build
variables:
CLOUD_ARCH: arm64
CLOUD_RELEASE: bullseye
CLOUD_VENDOR: generic
generic sid arm64 build:
extends: .generic build
variables:
CLOUD_ARCH: arm64
CLOUD_RELEASE: sid
CLOUD_VENDOR: generic
generic buster ppc64el build:
extends: .generic build
variables:
CLOUD_ARCH: ppc64el
CLOUD_RELEASE: buster
CLOUD_VENDOR: generic
generic bullseye ppc64el build:
extends: .generic build
variables:
CLOUD_ARCH: ppc64el
CLOUD_RELEASE: bullseye
CLOUD_VENDOR: generic
generic sid ppc64el build:
extends: .generic build
variables:
CLOUD_ARCH: ppc64el
CLOUD_RELEASE: sid
CLOUD_VENDOR: generic
genericcloud buster amd64 build:
extends: .generic build
variables:
CLOUD_ARCH: amd64
CLOUD_RELEASE: buster
CLOUD_VENDOR: genericcloud
genericcloud bullseye amd64 build:
extends: .generic build
variables:
CLOUD_ARCH: amd64
CLOUD_RELEASE: bullseye
CLOUD_VENDOR: genericcloud
genericcloud sid amd64 build:
extends: .generic build
variables:
CLOUD_ARCH: amd64
CLOUD_RELEASE: sid
CLOUD_VENDOR: genericcloud
.nocloud build:
extends: .build
rules:
- if: '$CI_MERGE_REQUEST_ID == null && $BUILD_NOCLOUD'
when: on_success
- if: '$CI_MERGE_REQUEST_ID == null'
when: manual
nocloud stretch amd64 build:
extends: .nocloud build
variables:
CLOUD_ARCH: amd64
CLOUD_RELEASE: stretch
CLOUD_VENDOR: nocloud
nocloud buster amd64 build:
extends: .nocloud build
variables:
CLOUD_ARCH: amd64
CLOUD_RELEASE: buster
CLOUD_VENDOR: nocloud
nocloud bullseye amd64 build:
extends: .nocloud build
variables:
CLOUD_ARCH: amd64
CLOUD_RELEASE: bullseye
CLOUD_VENDOR: nocloud
nocloud sid amd64 build:
extends: .nocloud build
variables:
CLOUD_ARCH: amd64
CLOUD_RELEASE: sid
CLOUD_VENDOR: nocloud
nocloud buster arm64 build:
extends: .nocloud build
variables:
CLOUD_ARCH: arm64
CLOUD_RELEASE: buster
CLOUD_VENDOR: nocloud
nocloud bullseye arm64 build:
extends: .nocloud build
variables:
CLOUD_ARCH: arm64
CLOUD_RELEASE: bullseye
CLOUD_VENDOR: nocloud
nocloud sid arm64 build:
extends: .nocloud build
variables:
CLOUD_ARCH: arm64
CLOUD_RELEASE: sid
CLOUD_VENDOR: nocloud
nocloud buster ppc64el build:
extends: .nocloud build
variables:
CLOUD_ARCH: ppc64el
CLOUD_RELEASE: buster
CLOUD_VENDOR: nocloud
nocloud bullseye ppc64el build:
extends: .nocloud build
variables:
CLOUD_ARCH: ppc64el
CLOUD_RELEASE: bullseye
CLOUD_VENDOR: nocloud
nocloud sid ppc64el build:
extends: .nocloud build
variables:
CLOUD_ARCH: ppc64el
CLOUD_RELEASE: sid
CLOUD_VENDOR: nocloud
####
# Provider uploads for developer pushs
####
azure upload:
stage: vendor upload
image: debian:buster
script:
- >
./bin/debian-cloud-images upload-azure
--config-file "${CLOUD_UPLOAD_DEV_CONFIG}"
*.build.json
dependencies:
- azure stretch build
- azure stretch-backports build
- azure buster build
- azure buster-backports build
- azure bullseye build
- azure sid build
artifacts:
name: upload-azure
expire_in: 7 days
paths:
- '*.upload-azure.json'
rules:
- if: '$CI_MERGE_REQUEST_ID == null && $CLOUD_UPLOAD_AZURE_DEV_ENABLED == "1" && $BUILD_AZURE'
when: on_success
- if: '$CI_MERGE_REQUEST_ID == null && $CLOUD_UPLOAD_AZURE_DEV_ENABLED == "1"'
when: manual
allow_failure: true
ec2 upload:
stage: vendor upload
image: debian:buster
script:
- >
./bin/debian-cloud-images upload-ec2
--config-file "${CLOUD_UPLOAD_DEV_CONFIG}"
*.build.json
dependencies:
- ec2 stretch amd64 build
- ec2 buster amd64 build
- ec2 bullseye amd64 build
- ec2 sid amd64 build
- ec2 stretch arm64 build
- ec2 buster arm64 build
- ec2 bullseye arm64 build
- ec2 sid arm64 build
artifacts:
name: upload-ec2
expire_in: 7 days
paths:
- '*.upload-ec2.json'
rules:
- if: '$CI_MERGE_REQUEST_ID == null && $CLOUD_UPLOAD_EC2_DEV_ENABLED == "1" && $BUILD_EC2'
when: on_success
- if: '$CI_MERGE_REQUEST_ID == null && $CLOUD_UPLOAD_EC2_DEV_ENABLED == "1"'
when: manual
allow_failure: true
gce upload:
stage: vendor upload
image: debian:buster
script:
- >
./bin/debian-cloud-images upload-gce
--config-file "${CLOUD_UPLOAD_DEV_CONFIG}"
*.build.json
dependencies:
- gce stretch build
- gce buster build
- gce bullseye build
- gce sid build
artifacts:
name: upload-gce
expire_in: 7 days
paths:
- '*.upload-gce.json'
rules:
- if: '$CI_MERGE_REQUEST_ID == null && $CLOUD_UPLOAD_GCE_DEV_ENABLED == "1" && $BUILD_GCE'
when: on_success
- if: '$CI_MERGE_REQUEST_ID == null && $CLOUD_UPLOAD_GCE_DEV_ENABLED == "1"'
when: manual
allow_failure: true