This repository has been archived by the owner on Jul 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
.gitlab-ci.yml
104 lines (86 loc) · 2.42 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
variables:
SYSTEM: cc7
NAME: gitlab-registry.cern.ch/swan/docker-images/systemuser
stages:
- build
- test
- deploy
- clean
build_final_image:
stage: build
script:
- docker login gitlab-registry.cern.ch -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD
- docker build --compress --squash --rm -t $CI_COMMIT_SHA$CI_PIPELINE_IID --build-arg BUILD_TAG=$CI_COMMIT_TAG .
- docker logout
tags:
- swan-runner
only:
- /^v.*$/
build_daily:
stage: build
script:
- docker login gitlab-registry.cern.ch -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD
- docker build --compress --rm -t $CI_COMMIT_SHA$CI_PIPELINE_IID --build-arg VERSION_NBEXTENSIONS=daily --build-arg CI_PIPELINE=$CI_PIPELINE_ID .
- docker logout
tags:
- swan-runner
except:
- /^v.*$/
test_all:
stage: test
script: python3 /home/tests/test_image.py --image $CI_COMMIT_SHA$CI_PIPELINE_IID --system $SYSTEM
tags:
- swan-runner
only:
- /^v.*$/
when: on_success
test_latest:
stage: test
script: python3 /home/tests/test_image.py --image $CI_COMMIT_SHA$CI_PIPELINE_IID --stack latest --system $SYSTEM
tags:
- swan-runner
except:
- /^v.*$/
- web
when: on_success
test_release:
stage: test
script: python3 /home/tests/test_image.py --image latest:$SYSTEM --system $SYSTEM --stack $STACK --platform $PLATFORM
tags:
- swan-runner
only:
- web
publish_image:
stage: deploy
script:
- docker tag $CI_COMMIT_SHA$CI_PIPELINE_IID latest:$SYSTEM
- docker tag $CI_COMMIT_SHA$CI_PIPELINE_IID $NAME:$CI_COMMIT_TAG
- docker login gitlab-registry.cern.ch -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD
- docker push $NAME:$CI_COMMIT_TAG
- docker logout
tags:
- swan-runner
only:
- /^v.*$/
except:
- web
when: on_success
publish_daily:
stage: deploy
script:
- docker tag $CI_COMMIT_SHA$CI_PIPELINE_IID $NAME:daily
- docker login gitlab-registry.cern.ch -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD
- docker push $NAME:daily
- docker logout
tags:
- swan-runner
only:
- schedules
when: on_success
clean_images:
stage: clean
script:
- docker rmi $CI_COMMIT_SHA$CI_PIPELINE_IID
tags:
- swan-runner
when: always