-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy path.gitlab-ci.yml
233 lines (204 loc) · 6.14 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
default:
tags:
- olivone
stages:
- prepare_pipeline
- build_images
- build_and_test
- artifact_store
- from_source
- publish_images
- cleanup
- staging
variables:
GIT_SUBMODULE_STRATEGY: normal
HOST_CACHES_PATH: /var/lib/gitlab-runner/cache/ids/sarus
get_credentials:
image: vault:1.13.3
stage: prepare_pipeline
tags:
- Fulen
- K8s
id_tokens:
VAULT_ID_TOKEN:
aud: https://git.cscs.ch
script:
- export VAULT_TOKEN="$(vault write -field=token auth/jwt_idtoken/login role=iam jwt=$VAULT_ID_TOKEN)"
- if [[ ${#VAULT_TOKEN} -lt 3 ]]; then echo "ERROR, Vault token empty"; exit 1; fi
- export JFROG_USER="$(vault kv get -field=JFROG_USER $VAULT_PATH)"
- export JFROG_TOKEN="$(vault kv get -field=JFROG_TOKEN $VAULT_PATH)"
- echo "JFROG_USER=${JFROG_USER}" >> credentials.env
- echo "JFROG_TOKEN=${JFROG_TOKEN}" >> credentials.env
artifacts:
public: false
expire_in: 200 minute
reports:
dotenv: credentials.env
clean_caches:
stage: prepare_pipeline
only:
- schedules
- clean-caches
script:
# Sarus known to be the only project running on this runner
# https://confluence.cscs.ch/x/Y4DtCw
- rm -rf $HOST_CACHES_PATH
- docker system prune -f
prepare_pipeline:
stage: prepare_pipeline
script:
- /home/gitlab-runner/sarus-ops/update.sh
- CI/check_host.sh
build_dependencies:
stage: build_images
script:
- . CI/utility_docker_functions.bash Debug gcc.cmake $(pwd) $HOST_CACHES_PATH standalone-build standalone-run
- sarus-build-images
documentation:
stage: build_and_test
script:
- . CI/utility_docker_functions.bash Debug gcc.cmake $(pwd) $HOST_CACHES_PATH standalone-build standalone-run
- sarus-check-version-and-docs $(pwd)
standalone_debug:
stage: build_and_test
script:
- . ./CI/utility_docker_functions.bash Debug gcc.cmake $(pwd) $HOST_CACHES_PATH standalone-build standalone-run
- sarus-build-and-test
artifacts:
name: "sarus-Debug-$CI_COMMIT_REF_NAME"
paths:
- sarus-Debug.tar.gz
- standalone/README.md
standalone_release:
stage: build_and_test
script:
- . ./CI/utility_docker_functions.bash Release gcc.cmake $(pwd) $HOST_CACHES_PATH standalone-build standalone-run
- sarus-build-and-test
artifacts:
name: "sarus-Release-$CI_COMMIT_REF_NAME"
paths:
- sarus-Release.tar.gz
- standalone/README.md
artifact_store:
stage: artifact_store
image: releases-docker.jfrog.io/jfrog/jfrog-cli
tags:
- Fulen
- K8s
script:
- NAME="sarus-Release-${CI_COMMIT_TAG}.tar.gz"
- echo ">>> Performing upload ${NAME} to ${JFROG_URL}"
- jfrog config add --artifactory-url=${JFROG_URL} --access-token=${JFROG_TOKEN} --user=${JFROG_USER}
- jfrog config show
- FILE="sarus-Release.tar.gz"
- jfrog rt u ${FILE} ${JFROG_REPO}/${NAME}
dependencies:
- get_credentials
- standalone_release
rules:
- if: $CI_COMMIT_TAG
.from_source:
stage: from_source
only:
- master
- develop
- web
coverage:
extends: .from_source
script:
- . ./CI/utility_docker_functions.bash Debug gcc-gcov.cmake $(pwd) $HOST_CACHES_PATH standalone-build standalone-run
- sarus-build-and-test
rocky8:
extends: .from_source
script:
- . ./CI/utility_docker_functions.bash Release gcc.cmake $(pwd) $HOST_CACHES_PATH rocky:8 rocky:8
- sarus-build-images
- sarus-build-from-scratch-and-test
rocky9:
extends: .from_source
script:
- . ./CI/utility_docker_functions.bash Release gcc.cmake $(pwd) $HOST_CACHES_PATH rocky:9 rocky:9
- sarus-build-images
- sarus-build-from-scratch-and-test
fedora38:
extends: .from_source
script:
- . ./CI/utility_docker_functions.bash Release gcc.cmake $(pwd) $HOST_CACHES_PATH fedora:38 fedora:38
- sarus-build-images
- sarus-build-from-scratch-and-test
ubuntu22.04:
extends: .from_source
script:
- . ./CI/utility_docker_functions.bash Release gcc.cmake $(pwd) $HOST_CACHES_PATH ubuntu:22.04 ubuntu:22.04
- sarus-build-images
- sarus-build-from-scratch-and-test
debian11:
extends: .from_source
script:
- . ./CI/utility_docker_functions.bash Release gcc.cmake $(pwd) $HOST_CACHES_PATH debian:11 debian:11
- sarus-build-images
- sarus-build-from-scratch-and-test
opensuseleap15.5:
extends: .from_source
script:
- . ./CI/utility_docker_functions.bash Release gcc.cmake $(pwd) $HOST_CACHES_PATH opensuseleap:15.5 opensuseleap:15.5
- sarus-build-images
- sarus-build-from-scratch-and-test
address_sanitizer:
extends: .from_source
script:
- . ./CI/utility_docker_functions.bash Debug gcc-asan.cmake $(pwd) $HOST_CACHES_PATH debian:11 debian:11
- sarus-build-images
- sarus-build-from-scratch-and-test
.spack_package:
extends: .from_source
timeout: 2h
script:
- sarus-build-images
- sarus-spack-test
spack_ubuntu18.04:
extends: .spack_package
before_script:
- . ./CI/utility_docker_functions.bash Release gcc.cmake $(pwd) $HOST_CACHES_PATH spack-ubuntu18.04 spack-ubuntu18.04
.scheduled_spack_package:
extends: .spack_package
only:
- schedules
spack_debian10:
extends: .scheduled_spack_package
before_script:
- . ./CI/utility_docker_functions.bash Release gcc.cmake $(pwd) $HOST_CACHES_PATH spack-debian10 spack-debian10
spack_fedora34:
extends: .scheduled_spack_package
before_script:
- . ./CI/utility_docker_functions.bash Release gcc.cmake $(pwd) $HOST_CACHES_PATH spack-fedora34 spack-fedora34
spack_opensuseleap15:
extends: .scheduled_spack_package
before_script:
- . ./CI/utility_docker_functions.bash Release gcc.cmake $(pwd) $HOST_CACHES_PATH spack-opensuseleap15 spack-opensuseleap15
publish_images:
stage: publish_images
only:
- master
- develop
script:
- . ./CI/utility_docker_functions.bash
- sarus-publish-images
cleanup_images:
stage: cleanup
except:
- master
- develop
script:
- . ./CI/utility_docker_functions.bash
- sarus-cleanup-images
trigger_ops:
stage: staging
variables:
TEMP_PACKAGE: "sarus-Release-$CI_COMMIT_TAG.tar.gz"
version: $CI_COMMIT_TAG
trigger:
project: 'ids/sarus-ops'
strategy: depend
rules:
- if: $CI_COMMIT_TAG