This repository has been archived by the owner on Apr 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
127 lines (107 loc) · 2.56 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
image: docker:latest
variables:
BASE_REPOSITORY: 'igwn/base'
stages:
- docker
- rebuild
docker:build:
stage: docker
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker build --no-cache --pull -t $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME .
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
- docker logout $CI_REGISTRY
- |
# push to docker hub
if [[ $CI_PROJECT_NAMESPACE == 'docker' ]]; then
docker login -u $DOCKER_HUB_USER -p $DOCKER_HUB_TOKEN
docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME $BASE_REPOSITORY:$CI_COMMIT_REF_NAME
docker push $BASE_REPOSITORY:$CI_COMMIT_REF_NAME
docker logout
fi
- |
# push to quay.io
if [[ $CI_PROJECT_NAMESPACE == 'docker' ]]; then
docker login -u $QUAY_USER -p $QUAY_TOKEN quay.io
docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME quay.io/$BASE_REPOSITORY:$CI_COMMIT_REF_NAME
docker push quay.io/$BASE_REPOSITORY:$CI_COMMIT_REF_NAME
docker logout quay.io
fi
#
# trigger rebuilds of downstream containers
#
# lalsuite-dev
rebuild:lalsuite-dev:
stage: rebuild
only:
- branches@docker/base
trigger:
project: docker/lalsuite-dev
branch: el7
# packaging
rebuild:el7-production:
stage: rebuild
only:
- branches@docker/base
trigger:
project: docker/packaging
branch: el7-production
rebuild:el7-production-staging:
stage: rebuild
only:
- branches@docker/base
trigger:
project: docker/packaging
branch: el7-production-staging
rebuild:el7-testing:
stage: rebuild
only:
- branches@docker/base
trigger:
project: docker/packaging
branch: el7-testing
rebuild:el7-staging:
stage: rebuild
only:
- branches@docker/base
trigger:
project: docker/packaging
branch: el7-staging
rebuild:el7-resync-testing:
stage: rebuild
only:
- branches@docker/base
trigger:
project: docker/packaging
branch: el7-resync-testing
rebuild:el7-resync-staging:
stage: rebuild
only:
- branches@docker/base
trigger:
project: docker/packaging
branch: el7-resync-staging
# ssh container
rebuild:ssh:
stage: rebuild
only:
- branches@docker/base
trigger:
project: docker/ssh
branch: el7
# software container
rebuild:software:
stage: rebuild
only:
- branches@docker/base
trigger:
project: docker/software
branch: el7
# builder container
rebuild:builder:
stage: rebuild
only:
- branches@docker/base
trigger:
project: docker/builder
branch: el7