-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
59 lines (56 loc) · 1.79 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
stages:
- build
.build_template:
stage: build
image:
# Use CERN version of the Kaniko image
name: gitlab-registry.cern.ch/ci-tools/docker-image-builder
entrypoint: [""]
variables:
CONTEXT: .
DOCKERFILE: <Dockerfile path>
VERSION: ${CI_COMMIT_REF_SLUG}
OSTAG: <Tag suffix corresponding to version>
# Use single quotes to escape colon
DESTINATION: '${CI_REGISTRY_IMAGE}/${IMAGE}:${VERSION}-${OSTAG}'
before_script:
# Prepare Kaniko configuration file
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
script:
- printenv
# Build and push the image from the given Dockerfile
# See https://docs.gitlab.com/ee/ci/variables/predefined_variables.html#variables-reference for available variables
- /kaniko/executor --context ${CI_PROJECT_DIR}/${CONTEXT}
--dockerfile ${DOCKERFILE}
--build-arg REPOSITORY=${CI_REGISTRY_IMAGE}
--build-arg VERSION=${VERSION}
--destination ${DESTINATION}
- echo /kaniko/executor --context ${CI_PROJECT_DIR}/${CONTEXT}
--dockerfile ${DOCKERFILE}
--build-arg REPOSITORY=${CI_REGISTRY_IMAGE}
--build-arg VERSION=${VERSION}
--destination ${DESTINATION}
# only:
# # Only build if the generating files change
# changes:
# - ${DOCKERFILE}
build-spack:
extends: .build_template
variables:
IMAGE: mucoll-spack
parallel:
matrix:
- CONTEXT: AlmaLinux9
DOCKERFILE: Dockerfile-spack
OSTAG: alma9
build-sim:
extends: .build_template
timeout: 12h # set job timeout to 12 hours
variables:
IMAGE: mucoll-sim
needs: [build-spack]
parallel:
matrix:
- CONTEXT: AlmaLinux9
DOCKERFILE: Dockerfile-sim
OSTAG: alma9