This repository has been archived by the owner on Jul 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy path.gitlab-ci.yml
806 lines (731 loc) · 28.6 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
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
image: docker:latest
variables:
DEBIAN_RELEASE: "bookworm"
DEBIAN_BASE_IMAGE: "bookworm-slim"
TORADEX_INTERNAL_DOCKERHUB_CACHE: "artifactory-horw.int.toradex.com/dockerhub-proxy-horw/"
# container version
DEBIAN_MAJOR: "3"
DEBIAN_MINOR: "0"
DEBIAN_PATCH: "6"
WAYLAND_BASE_MAJOR: "3"
WAYLAND_BASE_MINOR: "0"
WAYLAND_BASE_PATCH: "6"
WESTON_MAJOR: "3"
WESTON_MINOR: "0"
WESTON_PATCH: "8"
QT5_WAYLAND_MAJOR: "3"
QT5_WAYLAND_MINOR: "0"
QT5_WAYLAND_PATCH: "8"
QT5_WAYLAND_EXAMPLES_MAJOR: "3"
QT5_WAYLAND_EXAMPLES_MINOR: "0"
QT5_WAYLAND_EXAMPLES_PATCH: "8"
WAYLAND_BASE_VIVANTE_MAJOR: "3"
WAYLAND_BASE_VIVANTE_MINOR: "0"
WAYLAND_BASE_VIVANTE_PATCH: "7"
WESTON_VIVANTE_MAJOR: "3"
WESTON_VIVANTE_MINOR: "0"
WESTON_VIVANTE_PATCH: "9"
QT5_WAYLAND_VIVANTE_MAJOR: "3"
QT5_WAYLAND_VIVANTE_MINOR: "0"
QT5_WAYLAND_VIVANTE_PATCH: "9"
QT5_WAYLAND_EXAMPLES_VIVANTE_MAJOR: "3"
QT5_WAYLAND_EXAMPLES_VIVANTE_MINOR: "0"
QT5_WAYLAND_EXAMPLES_VIVANTE_PATCH: "9"
WESTON_TOUCH_CALIBRATOR_MAJOR: "3"
WESTON_TOUCH_CALIBRATOR_MINOR: "0"
WESTON_TOUCH_CALIBRATOR_PATCH: "6"
GRAPHICS_TESTS_MAJOR: "3"
GRAPHICS_TESTS_MINOR: "0"
GRAPHICS_TESTS_PATCH: "6"
GRAPHICS_TESTS_VIVANTE_MAJOR: "3"
GRAPHICS_TESTS_VIVANTE_MINOR: "0"
GRAPHICS_TESTS_VIVANTE_PATCH: "7"
# This should be set by docker image already, just to be sure...
DOCKER_HOST: tcp://docker:2375
# Use overlayfs driver for better performance
DOCKER_TLS_CERTDIR: ""
DOCKER_DRIVER: overlay2
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
GITLAB_DOCKERREGISTRY_SUFFIX: ${CI_COMMIT_REF_SLUG}-${CI_PIPELINE_ID}
GITLAB_DOCKERREGISTRY_SUFFIX_LATEST: ${CI_COMMIT_REF_SLUG}-latest
services:
- name: docker:dind
stages:
- lint
- repository tagging
- build-base
- build-stage1
- build-stage2
- build-stage3
- build-multiarch
- build-samples-bridge
- deploy
- deploy-multiarch
# Docker image builds
#
# Build the Docker images specificd in DOCKERFILE_FOLDER/IMAGE_NAME and push
# it to Gitlab's internal Docker registry
.docker-build:
variables:
IMAGE_TAG: ${CI_COMMIT_REF_SLUG}-${CI_PIPELINE_ID}
IMAGE_ARCH: linux/arm
ADD_TORADEX_REPOSITORY: 1
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker info
- if test -n "${BASE_NAME}"; then docker pull ${CI_REGISTRY_IMAGE}/${BASE_NAME}:${GITLAB_DOCKERREGISTRY_SUFFIX} && docker tag ${CI_REGISTRY_IMAGE}/${BASE_NAME}:${GITLAB_DOCKERREGISTRY_SUFFIX} torizon/${BASE_NAME}:${MAJOR}${DEBIAN_RELEASE_APPEND} ; fi || exit 1
# Try to download latest image for cache, but don't fail if it does not exist
- docker pull ${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:${GITLAB_DOCKERREGISTRY_SUFFIX_LATEST} || true
- docker pull ${CI_REGISTRY}/rd/torizon-core-containers/debian-docker-images/${IMAGE_NAME}:${GITLAB_DOCKERREGISTRY_SUFFIX_LATEST} || true
- export DATE=$(date +%Y%m%d)
# Ignore error "sh: write error: File exists" when installing qemu-user-static
- docker run --rm --privileged multiarch/qemu-user-static --reset -p yes || true
- docker build --build-arg IMAGE_ARCH=${IMAGE_ARCH}
--build-arg DOCKER_REGISTRY=${DOCKER_REGISTRY:-${CI_REGISTRY_IMAGE}}
--build-arg BASE_NAME=${BASE_NAME}
--build-arg IMAGE_TAG=${IMAGE_TAG}
--build-arg ADD_TORADEX_REPOSITORY=${ADD_TORADEX_REPOSITORY}
--build-arg ACCEPT_FSL_EULA=${ACCEPT_FSL_EULA}
--build-arg QT5_EXAMPLES_DEBIAN=${QT5_EXAMPLES_DEBIAN}
--build-arg TORADEX_SNAPSHOT=${TORADEX_SNAPSHOT:-20230328T092716Z}
--build-arg USE_TORADEX_SNAPSHOT=${USE_TORADEX_SNAPSHOT:-1}
${DOCKER_NO_CACHE:+--no-cache}
--label container.name=${IMAGE_NAME}
--label container.version=${MAJOR}.${MINOR}.${PATCH}-${DATE}
--label git.branch=${CI_COMMIT_BRANCH}
--label git.hash=${CI_COMMIT_SHA}
--label pipeline.id=${CI_PIPELINE_ID}
-f ${DOCKERFILE_FOLDER}Dockerfile
-t ${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:${GITLAB_DOCKERREGISTRY_SUFFIX}
-t ${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:${GITLAB_DOCKERREGISTRY_SUFFIX_LATEST}
${DOCKERFILE_FOLDER}
- docker push ${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:${GITLAB_DOCKERREGISTRY_SUFFIX}
- docker push ${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:${GITLAB_DOCKERREGISTRY_SUFFIX_LATEST}
docker-build-base:
extends: .docker-build
needs: []
before_script:
- export DOCKER_REGISTRY="${TORADEX_INTERNAL_DOCKERHUB_CACHE}"
- export MAJOR="${DEBIAN_MAJOR}"
- export MINOR="${DEBIAN_MINOR}"
- export PATCH="${DEBIAN_PATCH}"
variables:
IMAGE_TAG: ${DEBIAN_BASE_IMAGE}
IMAGE_ARCH: linux/arm/v7
IMAGE_NAME: arm32v7-debian-base
DOCKERFILE_FOLDER: "base/"
stage: build-base
docker-build-wayland-base:
extends: .docker-build
before_script:
- export DEBIAN_RELEASE_APPEND="-${DEBIAN_RELEASE}"
- export MAJOR="${WAYLAND_BASE_MAJOR}"
- export MINOR="${WAYLAND_BASE_MINOR}"
- export PATCH="${WAYLAND_BASE_PATCH}"
variables:
BASE_NAME: arm32v7-debian-base
IMAGE_NAME: arm32v7-debian-wayland-base
DOCKERFILE_FOLDER: "wayland-base/"
stage: build-stage1
docker-build-weston:
extends: .docker-build
before_script:
- export MAJOR="${WESTON_MAJOR}"
- export MINOR="${WESTON_MINOR}"
- export PATCH="${WESTON_PATCH}"
- ./weston/make_feature_map.sh
variables:
BASE_NAME: arm32v7-debian-wayland-base
IMAGE_NAME: weston
DOCKERFILE_FOLDER: "weston/"
stage: build-stage2
docker-build-graphics-tests:
extends: .docker-build
before_script:
- export MAJOR="${GRAPHICS_TESTS_MAJOR}"
- export MINOR="${GRAPHICS_TESTS_MINOR}"
- export PATCH="${GRAPHICS_TESTS_PATCH}"
variables:
BASE_NAME: arm32v7-debian-wayland-base
IMAGE_NAME: graphics-tests
DOCKERFILE_FOLDER: "graphics-tests/"
stage: build-stage2
docker-build-weston-touch-calibrator:
extends: .docker-build
before_script:
- export MAJOR="${WESTON_TOUCH_CALIBRATOR_MAJOR}"
- export MINOR="${WESTON_TOUCH_CALIBRATOR_MINOR}"
- export PATCH="${WESTON_TOUCH_CALIBRATOR_PATCH}"
variables:
BASE_NAME: weston
IMAGE_NAME: arm32v7-debian-weston-touch-calibrator
DOCKERFILE_FOLDER: "weston-touch-calibrator/"
stage: build-stage3
docker-build-qt5-wayland:
extends: .docker-build
before_script:
- export MAJOR="${QT5_WAYLAND_MAJOR}"
- export MINOR="${QT5_WAYLAND_MINOR}"
- export PATCH="${QT5_WAYLAND_PATCH}"
variables:
BASE_NAME: arm32v7-debian-wayland-base
IMAGE_NAME: arm32v7-debian-qt5-wayland
DOCKERFILE_FOLDER: "qt5-wayland/"
stage: build-stage2
docker-build-qt5-wayland-examples:
extends: .docker-build
before_script:
- export MAJOR="${QT5_WAYLAND_EXAMPLES_MAJOR}"
- export MINOR="${QT5_WAYLAND_EXAMPLES_MINOR}"
- export PATCH="${QT5_WAYLAND_EXAMPLES_PATCH}"
variables:
BASE_NAME: arm32v7-debian-qt5-wayland
IMAGE_NAME: arm32v7-debian-qt5-wayland-examples
QT5_EXAMPLES_DEBIAN: 1
DOCKERFILE_FOLDER: "qt5-wayland-examples/"
stage: build-stage3
docker-build-base-arm64v8:
extends: .docker-build
needs: []
before_script:
- export DOCKER_REGISTRY="${TORADEX_INTERNAL_DOCKERHUB_CACHE}"
- export MAJOR="${DEBIAN_MAJOR}"
- export MINOR="${DEBIAN_MINOR}"
- export PATCH="${DEBIAN_PATCH}"
variables:
IMAGE_TAG: ${DEBIAN_BASE_IMAGE}
IMAGE_ARCH: linux/arm64/v8
IMAGE_NAME: arm64v8-debian-base
DOCKERFILE_FOLDER: "base/"
stage: build-base
docker-build-wayland-base-arm64v8:
extends: .docker-build
before_script:
- export DEBIAN_RELEASE_APPEND="-${DEBIAN_RELEASE}"
- export MAJOR="${WAYLAND_BASE_MAJOR}"
- export MINOR="${WAYLAND_BASE_MINOR}"
- export PATCH="${WAYLAND_BASE_PATCH}"
variables:
IMAGE_ARCH: linux/arm64
BASE_NAME: arm64v8-debian-base
IMAGE_NAME: arm64v8-debian-wayland-base
DOCKERFILE_FOLDER: "wayland-base/"
stage: build-stage1
docker-build-wayland-base-vivante:
extends: .docker-build
before_script:
- export DEBIAN_RELEASE_APPEND="-${DEBIAN_RELEASE}"
- export MAJOR="${WAYLAND_BASE_VIVANTE_MAJOR}"
- export MINOR="${WAYLAND_BASE_VIVANTE_MINOR}"
- export PATCH="${WAYLAND_BASE_VIVANTE_PATCH}"
variables:
IMAGE_ARCH: linux/arm64
BASE_NAME: arm64v8-debian-base
IMAGE_NAME: wayland-base-vivante
ACCEPT_FSL_EULA: 1
DOCKERFILE_FOLDER: "wayland-base-vivante/"
DOCKER_NO_CACHE: ${DOCKER_NO_CACHE_VIVANTE}
stage: build-stage1
docker-build-weston-vivante:
extends: .docker-build
before_script:
- export MAJOR="${WESTON_VIVANTE_MAJOR}"
- export MINOR="${WESTON_VIVANTE_MINOR}"
- export PATCH="${WESTON_VIVANTE_PATCH}"
- ./weston/make_feature_map.sh
variables:
IMAGE_ARCH: linux/arm64
BASE_NAME: wayland-base-vivante
IMAGE_NAME: weston-vivante
ACCEPT_FSL_EULA: 1
DOCKERFILE_FOLDER: "weston/"
DOCKER_NO_CACHE: ${DOCKER_NO_CACHE_VIVANTE}
stage: build-stage2
docker-build-graphics-tests-vivante:
extends: .docker-build
before_script:
- export MAJOR="${GRAPHICS_TESTS_VIVANTE_MAJOR}"
- export MINOR="${GRAPHICS_TESTS_VIVANTE_MINOR}"
- export PATCH="${GRAPHICS_TESTS_VIVANTE_PATCH}"
variables:
IMAGE_ARCH: linux/arm64
BASE_NAME: wayland-base-vivante
IMAGE_NAME: graphics-tests-vivante
DOCKERFILE_FOLDER: "graphics-tests-vivante/"
DOCKER_NO_CACHE: ${DOCKER_NO_CACHE_VIVANTE}
stage: build-stage2
docker-build-weston-touch-calibrator-arm64v8:
extends: .docker-build
before_script:
- export MAJOR="${WESTON_TOUCH_CALIBRATOR_MAJOR}"
- export MINOR="${WESTON_TOUCH_CALIBRATOR_MINOR}"
- export PATCH="${WESTON_TOUCH_CALIBRATOR_PATCH}"
variables:
IMAGE_ARCH: linux/arm64
BASE_NAME: weston-vivante
IMAGE_NAME: arm64v8-debian-weston-touch-calibrator
DOCKERFILE_FOLDER: "weston-touch-calibrator/"
DOCKER_NO_CACHE: ${DOCKER_NO_CACHE_VIVANTE}
stage: build-stage3
docker-build-qt5-wayland-arm64v8:
extends: .docker-build
before_script:
- export MAJOR="${QT5_WAYLAND_MAJOR}"
- export MINOR="${QT5_WAYLAND_MINOR}"
- export PATCH="${QT5_WAYLAND_PATCH}"
variables:
IMAGE_ARCH: linux/arm64
BASE_NAME: arm64v8-debian-wayland-base
IMAGE_NAME: arm64v8-debian-qt5-wayland
DOCKERFILE_FOLDER: "qt5-wayland/"
stage: build-stage2
docker-build-qt5-wayland-examples-arm64v8:
extends: .docker-build
before_script:
- export MAJOR="${QT5_WAYLAND_EXAMPLES_MAJOR}"
- export MINOR="${QT5_WAYLAND_EXAMPLES_MINOR}"
- export PATCH="${QT5_WAYLAND_EXAMPLES_PATCH}"
variables:
IMAGE_ARCH: linux/arm64
BASE_NAME: arm64v8-debian-qt5-wayland
IMAGE_NAME: arm64v8-debian-qt5-wayland-examples
QT5_EXAMPLES_DEBIAN: 1
DOCKERFILE_FOLDER: "qt5-wayland-examples/"
stage: build-stage3
docker-build-qt5-wayland-vivante:
extends: .docker-build
before_script:
- export MAJOR="${QT5_WAYLAND_VIVANTE_MAJOR}"
- export MINOR="${QT5_WAYLAND_VIVANTE_MINOR}"
- export PATCH="${QT5_WAYLAND_VIVANTE_PATCH}"
variables:
IMAGE_ARCH: linux/arm64
BASE_NAME: wayland-base-vivante
IMAGE_NAME: qt5-wayland-vivante
DOCKERFILE_FOLDER: "qt5-wayland/"
DOCKER_NO_CACHE: ${DOCKER_NO_CACHE_VIVANTE}
stage: build-stage2
docker-build-qt5-wayland-vivante-examples:
extends: .docker-build
before_script:
- export MAJOR="${QT5_WAYLAND_EXAMPLES_VIVANTE_MAJOR}"
- export MINOR="${QT5_WAYLAND_EXAMPLES_VIVANTE_MINOR}"
- export PATCH="${QT5_WAYLAND_EXAMPLES_VIVANTE_PATCH}"
variables:
IMAGE_ARCH: linux/arm64
BASE_NAME: qt5-wayland-vivante
IMAGE_NAME: qt5-wayland-examples-vivante
QT5_EXAMPLES_DEBIAN: 1
DOCKERFILE_FOLDER: "qt5-wayland-examples/"
DOCKER_NO_CACHE: ${DOCKER_NO_CACHE_VIVANTE}
stage: build-stage3
lint_dockerfile:
stage: lint
image: hadolint/hadolint:latest-debian
script:
# Some rules cannot be applied in our specific cases.
# However, since we don't want to completely ignore these rules,
# we are changing the following rules to have the level "info":
# - DL3002 (last user should not be root)
# - DL3003 (use WORKDIR to switch to a directory)
# - DL3006 (always tag the version of an image explicitly)
# - DL3008 (pin versions in apt-get install)
# - DL3020 (use COPY instead of ADD for files and folders)
# - DL3029 (do not use --platform flag with FROM)
# - DL4006 (set the SHELL option -o pipefail before RUN with a pipe in it)
# - SC2039 (in POSIX sh, something is undefined)
# - SC2046 (quote this to prevent word splitting)
- hadolint */Dockerfile --failure-threshold warning --info DL3002 --info DL3003 --info DL3006 --info DL3008 --info DL3020 --info DL3029 --info DL4006 --info SC2039 --info SC2046
.shellcheck:
stage: lint
image: koalaman/shellcheck-alpine:latest
.shellcheck-git:
extends: .shellcheck
before_script:
- apk update
- apk add git
script:
git ls-files --exclude='*.sh' --ignored -c -z | xargs -0r shellcheck
shell-errors:
extends: .shellcheck-git
# Let's incrementally fix the errors and then disable the allow_failure property for this job.
allow_failure: true
variables:
SHELLCHECK_SEVERITY: 'error'
shell-warnings:
extends: .shellcheck-git
allow_failure: true
variables:
SHELLCHECK_SEVERITY: 'warning'
shell-format:
image: mvdan/shfmt:v3.2.0-alpine
stage: lint
before_script:
- apk update
- apk add git
# Let's incrementally fix the errors and then disable the allow_failure property for this job.
allow_failure: true
script:
- git ls-files --exclude='*.sh' --ignored -c -z | xargs -0r shfmt -i 2 -ci -d
# Make sure to create access token in "Settings/Access Tokens" section with "write_repository" scope selected.
# Then in "Settings/CI/CD/" section add a variable with key "GIT_TOKEN" and a value of the access token. Also mask the variable.
tag:
stage: repository tagging
needs: []
before_script:
- if [ -z ${GIT_TOKEN} ]; then echo "Missing variable GIT_TOKEN." && exit 1; fi
- TAGS="debian-${DEBIAN_MAJOR}.${DEBIAN_MINOR}.${DEBIAN_PATCH}
wayland-base-${WAYLAND_BASE_MAJOR}.${WAYLAND_BASE_MINOR}.${WAYLAND_BASE_PATCH}
weston-${WESTON_MAJOR}.${WESTON_MINOR}.${WESTON_PATCH}
qt5-wayland-${QT5_WAYLAND_MAJOR}.${QT5_WAYLAND_MINOR}.${QT5_WAYLAND_PATCH}
qt5-wayland-examples-${QT5_WAYLAND_EXAMPLES_MAJOR}.${QT5_WAYLAND_EXAMPLES_MINOR}.${QT5_WAYLAND_EXAMPLES_PATCH}
wayland-base-vivante-${WAYLAND_BASE_VIVANTE_MAJOR}.${WAYLAND_BASE_VIVANTE_MINOR}.${WAYLAND_BASE_VIVANTE_PATCH}
weston-vivante-${WESTON_VIVANTE_MAJOR}.${WESTON_VIVANTE_MINOR}.${WESTON_VIVANTE_PATCH}
qt5-wayland-vivante-${QT5_WAYLAND_VIVANTE_MAJOR}.${QT5_WAYLAND_VIVANTE_MINOR}.${QT5_WAYLAND_VIVANTE_PATCH}
qt5-wayland-examples-vivante-${QT5_WAYLAND_EXAMPLES_VIVANTE_MAJOR}.${QT5_WAYLAND_EXAMPLES_VIVANTE_MINOR}.${QT5_WAYLAND_EXAMPLES_VIVANTE_PATCH}
weston-touch-calibrator-${WESTON_TOUCH_CALIBRATOR_MAJOR}.${WESTON_TOUCH_CALIBRATOR_MINOR}.${WESTON_TOUCH_CALIBRATOR_PATCH}
graphics-tests-${GRAPHICS_TESTS_MAJOR}.${GRAPHICS_TESTS_MINOR}.${GRAPHICS_TESTS_PATCH}
graphics-tests-vivante-${GRAPHICS_TESTS_VIVANTE_MAJOR}.${GRAPHICS_TESTS_VIVANTE_MINOR}.${GRAPHICS_TESTS_VIVANTE_PATCH}"
script:
- apk update && apk add git
- git remote set-url origin https://gitlab-ci-token:${GIT_TOKEN}@${CI_REPOSITORY_URL#*@}
- for TAG in ${TAGS};
do
if git ls-remote --tags origin | grep ${TAG} > /dev/null; then
echo "${TAG} tag already exists.";
else
echo "Tagging repository with ${TAG} tag.";
git tag --delete ${TAG} > /dev/null 2>&1 || true;
git tag ${TAG};
git push -o ci.skip origin ${TAG};
fi
done
# Enable experimental features in Docker client (experimental feature are needed for manifest)
.do_docker_experimental: &do_docker_experimental
- mkdir -p $HOME/.docker
- "echo -e '{\n \"experimental\": \"enabled\"\n}' | tee $HOME/.docker/config.json"
- docker version
.docker-build-multiarch:
before_script:
- *do_docker_experimental
- rm -rf ~/.docker/manifests/*
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker pull ${CI_REGISTRY_IMAGE}/${IMAGE_NAME_32}:${GITLAB_DOCKERREGISTRY_SUFFIX}
- docker pull ${CI_REGISTRY_IMAGE}/${IMAGE_NAME_64}:${GITLAB_DOCKERREGISTRY_SUFFIX}
- docker manifest create ${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:${GITLAB_DOCKERREGISTRY_SUFFIX_LATEST} ${CI_REGISTRY_IMAGE}/${IMAGE_NAME_32}:${GITLAB_DOCKERREGISTRY_SUFFIX} ${CI_REGISTRY_IMAGE}/${IMAGE_NAME_64}:${GITLAB_DOCKERREGISTRY_SUFFIX}
- docker manifest annotate ${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:${GITLAB_DOCKERREGISTRY_SUFFIX_LATEST} ${CI_REGISTRY_IMAGE}/${IMAGE_NAME_32}:${GITLAB_DOCKERREGISTRY_SUFFIX} --os linux --arch arm
- docker manifest annotate ${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:${GITLAB_DOCKERREGISTRY_SUFFIX_LATEST} ${CI_REGISTRY_IMAGE}/${IMAGE_NAME_64}:${GITLAB_DOCKERREGISTRY_SUFFIX} --os linux --arch arm64
- docker manifest inspect -v ${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:${GITLAB_DOCKERREGISTRY_SUFFIX_LATEST}
- docker manifest push ${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:${GITLAB_DOCKERREGISTRY_SUFFIX_LATEST}
docker-build-base-multiarch:
extends: .docker-build-multiarch
variables:
IMAGE_NAME: base
IMAGE_NAME_32: arm32v7-debian-base
IMAGE_NAME_64: arm64v8-debian-base
stage: build-multiarch
docker-build-wayland-base-multiarch:
extends: .docker-build-multiarch
variables:
IMAGE_NAME: wayland-base
IMAGE_NAME_32: arm32v7-debian-wayland-base
IMAGE_NAME_64: arm64v8-debian-wayland-base
stage: build-multiarch
docker-build-qt5-wayland-multiarch:
extends: .docker-build-multiarch
variables:
IMAGE_NAME: qt5-wayland
IMAGE_NAME_32: arm32v7-debian-qt5-wayland
IMAGE_NAME_64: arm64v8-debian-qt5-wayland
stage: build-multiarch
docker-build-qt5-wayland-examples-multiarch:
extends: .docker-build-multiarch
variables:
IMAGE_NAME: qt5-wayland-examples
IMAGE_NAME_32: arm32v7-debian-qt5-wayland-examples
IMAGE_NAME_64: arm64v8-debian-qt5-wayland-examples
stage: build-multiarch
docker-build-weston-touch-calibrator-multiarch:
extends: .docker-build-multiarch
variables:
IMAGE_NAME: weston-touch-calibrator
IMAGE_NAME_32: arm32v7-debian-weston-touch-calibrator
IMAGE_NAME_64: arm64v8-debian-weston-touch-calibrator
stage: build-multiarch
# Bridge
#
# Trigger pipelines on other projects, for example, the Torizon samples
build-torizon-samples:
when: manual
stage: build-samples-bridge
trigger:
project: rd/torizon-core/samples
branch: ${DEBIAN_RELEASE}
strategy: depend
# Don't fail a pipeline on the current project if the samples pipeline fail
allow_failure: true
# Docker deploy jobs
#
# Make sure DOCKER_HUB_USER/DOCKER_HUB_TOKEN is properly set in the project
# specific Gitlab CI settings.
.docker-deploy:
when: manual
allow_failure: false
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
when: manual
script:
- *do_docker_experimental
- export DATE=$(date +%Y%m%d)
- export DOCKER_TAGS_CHECK="${MAJOR}.${MINOR}.${PATCH}${DEBIAN_RELEASE_APPEND} ${MAJOR}.${MINOR}.${PATCH}-${DATE}${DEBIAN_RELEASE_APPEND}"
- export DOCKER_TAGS="${MAJOR}${DEBIAN_RELEASE_APPEND} ${MAJOR}.${MINOR}${DEBIAN_RELEASE_APPEND}"
- docker pull ${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:${GITLAB_DOCKERREGISTRY_SUFFIX}
- docker login -u $DOCKER_HUB_USER -p $DOCKER_HUB_TOKEN;
- for tag in ${DOCKER_TAGS_CHECK};
do
docker manifest inspect ${DOCKER_HUB_REPOSITORY}/${IMAGE_NAME}:${tag} > /dev/null && true; RESULT=$?;
(if [ $RESULT == 0 ] ; then echo "Image with ${tag} tag already exists." && exit 1 ; fi);
done
- for tag in ${DOCKER_TAGS} ${DOCKER_TAGS_CHECK};
do
docker tag ${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:${GITLAB_DOCKERREGISTRY_SUFFIX} ${DOCKER_HUB_REPOSITORY}/${IMAGE_NAME}:${tag};
docker push ${DOCKER_HUB_REPOSITORY}/${IMAGE_NAME}:${tag};
done
docker-deploy-base:
extends: .docker-deploy
before_script:
- export DEBIAN_RELEASE_APPEND="-${DEBIAN_RELEASE}"
- export MAJOR="${DEBIAN_MAJOR}"
- export MINOR="${DEBIAN_MINOR}"
- export PATCH="${DEBIAN_PATCH}"
variables:
IMAGE_NAME: arm32v7-debian-base
stage: deploy
docker-deploy-wayland-base:
extends: .docker-deploy
before_script:
- export MAJOR="${WAYLAND_BASE_MAJOR}"
- export MINOR="${WAYLAND_BASE_MINOR}"
- export PATCH="${WAYLAND_BASE_PATCH}"
variables:
IMAGE_NAME: arm32v7-debian-wayland-base
stage: deploy
docker-deploy-weston:
extends: .docker-deploy
before_script:
- export MAJOR="${WESTON_MAJOR}"
- export MINOR="${WESTON_MINOR}"
- export PATCH="${WESTON_PATCH}"
variables:
IMAGE_NAME: weston
stage: deploy
docker-deploy-graphics-tests:
extends: .docker-deploy
before_script:
- export MAJOR="${GRAPHICS_TESTS_MAJOR}"
- export MINOR="${GRAPHICS_TESTS_MINOR}"
- export PATCH="${GRAPHICS_TESTS_PATCH}"
variables:
IMAGE_NAME: graphics-tests
stage: deploy
docker-deploy-weston-touch-calibrator:
extends: .docker-deploy
before_script:
- export MAJOR="${WESTON_TOUCH_CALIBRATOR_MAJOR}"
- export MINOR="${WESTON_TOUCH_CALIBRATOR_MINOR}"
- export PATCH="${WESTON_TOUCH_CALIBRATOR_PATCH}"
variables:
IMAGE_NAME: arm32v7-debian-weston-touch-calibrator
stage: deploy
docker-deploy-qt5-wayland:
extends: .docker-deploy
before_script:
- export MAJOR="${QT5_WAYLAND_MAJOR}"
- export MINOR="${QT5_WAYLAND_MINOR}"
- export PATCH="${QT5_WAYLAND_PATCH}"
variables:
IMAGE_NAME: arm32v7-debian-qt5-wayland
stage: deploy
docker-deploy-qt5-wayland-examples:
extends: .docker-deploy
before_script:
- export MAJOR="${QT5_WAYLAND_EXAMPLES_MAJOR}"
- export MINOR="${QT5_WAYLAND_EXAMPLES_MINOR}"
- export PATCH="${QT5_WAYLAND_EXAMPLES_PATCH}"
variables:
IMAGE_NAME: arm32v7-debian-qt5-wayland-examples
stage: deploy
docker-deploy-base-arm64v8:
extends: .docker-deploy
before_script:
- export DEBIAN_RELEASE_APPEND="-${DEBIAN_RELEASE}"
- export MAJOR="${DEBIAN_MAJOR}"
- export MINOR="${DEBIAN_MINOR}"
- export PATCH="${DEBIAN_PATCH}"
variables:
IMAGE_NAME: arm64v8-debian-base
stage: deploy
docker-deploy-wayland-base-arm64v8:
extends: .docker-deploy
before_script:
- export MAJOR="${WAYLAND_BASE_MAJOR}"
- export MINOR="${WAYLAND_BASE_MINOR}"
- export PATCH="${WAYLAND_BASE_PATCH}"
variables:
IMAGE_NAME: arm64v8-debian-wayland-base
stage: deploy
docker-deploy-wayland-base-vivante:
extends: .docker-deploy
before_script:
- export MAJOR="${WAYLAND_BASE_VIVANTE_MAJOR}"
- export MINOR="${WAYLAND_BASE_VIVANTE_MINOR}"
- export PATCH="${WAYLAND_BASE_VIVANTE_PATCH}"
variables:
IMAGE_NAME: wayland-base-vivante
stage: deploy
docker-deploy-weston-vivante:
extends: .docker-deploy
before_script:
- export MAJOR="${WESTON_VIVANTE_MAJOR}"
- export MINOR="${WESTON_VIVANTE_MINOR}"
- export PATCH="${WESTON_VIVANTE_PATCH}"
variables:
IMAGE_NAME: weston-vivante
stage: deploy
docker-deploy-graphics-tests-vivante:
extends: .docker-deploy
before_script:
- export MAJOR="${GRAPHICS_TESTS_VIVANTE_MAJOR}"
- export MINOR="${GRAPHICS_TESTS_VIVANTE_MINOR}"
- export PATCH="${GRAPHICS_TESTS_VIVANTE_PATCH}"
variables:
IMAGE_NAME: graphics-tests-vivante
stage: deploy
docker-deploy-weston-touch-calibrator-arm64v8:
extends: .docker-deploy
before_script:
- export MAJOR="${WESTON_TOUCH_CALIBRATOR_MAJOR}"
- export MINOR="${WESTON_TOUCH_CALIBRATOR_MINOR}"
- export PATCH="${WESTON_TOUCH_CALIBRATOR_PATCH}"
variables:
IMAGE_NAME: arm64v8-debian-weston-touch-calibrator
stage: deploy
docker-deploy-qt5-wayland-arm64v8:
extends: .docker-deploy
before_script:
- export MAJOR="${QT5_WAYLAND_MAJOR}"
- export MINOR="${QT5_WAYLAND_MINOR}"
- export PATCH="${QT5_WAYLAND_PATCH}"
variables:
IMAGE_NAME: arm64v8-debian-qt5-wayland
stage: deploy
docker-deploy-qt5-wayland-vivante:
extends: .docker-deploy
before_script:
- export MAJOR="${QT5_WAYLAND_VIVANTE_MAJOR}"
- export MINOR="${QT5_WAYLAND_VIVANTE_MINOR}"
- export PATCH="${QT5_WAYLAND_VIVANTE_PATCH}"
variables:
IMAGE_NAME: qt5-wayland-vivante
stage: deploy
docker-deploy-qt5-wayland-examples-arm64v8:
extends: .docker-deploy
before_script:
- export MAJOR="${QT5_WAYLAND_EXAMPLES_MAJOR}"
- export MINOR="${QT5_WAYLAND_EXAMPLES_MINOR}"
- export PATCH="${QT5_WAYLAND_EXAMPLES_PATCH}"
variables:
IMAGE_NAME: arm64v8-debian-qt5-wayland-examples
stage: deploy
docker-deploy-qt5-wayland-examples-vivante:
extends: .docker-deploy
before_script:
- export MAJOR="${QT5_WAYLAND_EXAMPLES_VIVANTE_MAJOR}"
- export MINOR="${QT5_WAYLAND_EXAMPLES_VIVANTE_MINOR}"
- export PATCH="${QT5_WAYLAND_EXAMPLES_VIVANTE_PATCH}"
variables:
IMAGE_NAME: qt5-wayland-examples-vivante
stage: deploy
.docker-deploy-multiarch:
script:
- *do_docker_experimental
- export DATE=$(date +%Y%m%d)
- export DOCKER_TAGS_CHECK="${MAJOR}.${MINOR}.${PATCH}${DEBIAN_RELEASE_APPEND} ${MAJOR}.${MINOR}.${PATCH}-${DATE}${DEBIAN_RELEASE_APPEND}"
- export DOCKER_TAGS="${MAJOR}${DEBIAN_RELEASE_APPEND} ${MAJOR}.${MINOR}${DEBIAN_RELEASE_APPEND}"
- rm -rf ~/.docker/manifests/*
- docker login -u $DOCKER_HUB_USER -p $DOCKER_HUB_TOKEN
- for tag in ${DOCKER_TAGS_CHECK};
do
docker manifest inspect ${DOCKER_HUB_REPOSITORY}/${IMAGE_NAME}:${tag} > /dev/null && true; RESULT=$?;
(if [ $RESULT == 0 ] ; then echo "Image with ${tag} tag already exists." && exit 1 ; fi);
done
- for tag in ${DOCKER_TAGS} ${DOCKER_TAGS_CHECK};
do
docker manifest create ${DOCKER_HUB_REPOSITORY}/${IMAGE_NAME}:${tag} ${DOCKER_HUB_REPOSITORY}/${IMAGE_NAME_32}:${tag} ${DOCKER_HUB_REPOSITORY}/${IMAGE_NAME_64}:${tag};
docker manifest annotate ${DOCKER_HUB_REPOSITORY}/${IMAGE_NAME}:${tag} ${DOCKER_HUB_REPOSITORY}/${IMAGE_NAME_32}:${tag} --os linux --arch arm;
docker manifest annotate ${DOCKER_HUB_REPOSITORY}/${IMAGE_NAME}:${tag} ${DOCKER_HUB_REPOSITORY}/${IMAGE_NAME_64}:${tag} --os linux --arch arm64;
docker manifest inspect -v ${DOCKER_HUB_REPOSITORY}/${IMAGE_NAME}:${tag};
docker manifest push ${DOCKER_HUB_REPOSITORY}/${IMAGE_NAME}:${tag};
done
docker-deploy-base-multiarch:
extends: .docker-deploy-multiarch
needs: ["docker-deploy-base", "docker-deploy-base-arm64v8"]
before_script:
- export DEBIAN_RELEASE_APPEND="-${DEBIAN_RELEASE}"
- export MAJOR="${DEBIAN_MAJOR}"
- export MINOR="${DEBIAN_MINOR}"
- export PATCH="${DEBIAN_PATCH}"
variables:
IMAGE_NAME: debian
IMAGE_NAME_32: arm32v7-debian-base
IMAGE_NAME_64: arm64v8-debian-base
stage: deploy-multiarch
docker-deploy-wayland-base-multiarch:
extends: .docker-deploy-multiarch
needs: ["docker-deploy-wayland-base", "docker-deploy-wayland-base-arm64v8"]
before_script:
- export MAJOR="${WAYLAND_BASE_MAJOR}"
- export MINOR="${WAYLAND_BASE_MINOR}"
- export PATCH="${WAYLAND_BASE_PATCH}"
variables:
IMAGE_NAME: wayland-base
IMAGE_NAME_32: arm32v7-debian-wayland-base
IMAGE_NAME_64: arm64v8-debian-wayland-base
stage: deploy-multiarch
docker-deploy-qt5-wayland-multiarch:
extends: .docker-deploy-multiarch
needs: ["docker-deploy-qt5-wayland", "docker-deploy-qt5-wayland-arm64v8"]
before_script:
- export MAJOR="${QT5_WAYLAND_MAJOR}"
- export MINOR="${QT5_WAYLAND_MINOR}"
- export PATCH="${QT5_WAYLAND_PATCH}"
variables:
IMAGE_NAME: qt5-wayland
IMAGE_NAME_32: arm32v7-debian-qt5-wayland
IMAGE_NAME_64: arm64v8-debian-qt5-wayland
stage: deploy-multiarch
docker-deploy-qt5-wayland-examples-multiarch:
extends: .docker-deploy-multiarch
needs: ["docker-deploy-qt5-wayland-examples", "docker-deploy-qt5-wayland-examples-arm64v8"]
before_script:
- export MAJOR="${QT5_WAYLAND_EXAMPLES_MAJOR}"
- export MINOR="${QT5_WAYLAND_EXAMPLES_MINOR}"
- export PATCH="${QT5_WAYLAND_EXAMPLES_PATCH}"
variables:
IMAGE_NAME: qt5-wayland-examples
IMAGE_NAME_32: arm32v7-debian-qt5-wayland-examples
IMAGE_NAME_64: arm64v8-debian-qt5-wayland-examples
stage: deploy-multiarch
docker-deploy-weston-touch-calibrator-multiarch:
extends: .docker-deploy-multiarch
needs: ["docker-deploy-weston-touch-calibrator", "docker-deploy-weston-touch-calibrator-arm64v8"]
before_script:
- export MAJOR="${WESTON_TOUCH_CALIBRATOR_MAJOR}"
- export MINOR="${WESTON_TOUCH_CALIBRATOR_MINOR}"
- export PATCH="${WESTON_TOUCH_CALIBRATOR_PATCH}"
variables:
IMAGE_NAME: weston-touch-calibrator
IMAGE_NAME_32: arm32v7-debian-weston-touch-calibrator
IMAGE_NAME_64: arm64v8-debian-weston-touch-calibrator
stage: deploy-multiarch