-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
60 lines (54 loc) · 1.63 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
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == "web"
- if: $CI_COMMIT_BRANCH == "master"
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_TLS_CERTDIR: ""
CI_REGISTRY: luthien.itefi.csic.es:10521
IMAGE: $CI_REGISTRY/$CI_PROJECT_PATH
default:
image: docker:26.1
services:
- name: docker:26.1-dind
command: ["--insecure-registry=luthien.itefi.csic.es:10521"]
before_script:
- |
cat << EOF > /tmp/token
username=oauth2
password=$SPIRS_TOKEN
EOF
- echo "$CI_REGISTRY_PASSWORD" | docker login $CI_REGISTRY -u $CI_REGISTRY_USER --password-stdin
optimized:
stage: build
when: manual
variables:
OPT_IMAGE: $IMAGE:optimized
script:
- docker build --secret=id=gitlab,src=/tmp/token -t $OPT_IMAGE -f docker/Dockerfile.optimized .
- docker push $OPT_IMAGE
container:
stage: build
when: manual
variables:
NR_IMAGE: $IMAGE:norepo
LAT_IMAGE: $IMAGE:latest
script:
- sed -i "1s@glcr.gicp.es@$CI_REGISTRY@" docker/Dockerfile
- sed -i '$s/^/#/' docker/Dockerfile
- docker build --secret=id=gitlab,src=/tmp/token -t $NR_IMAGE -f docker/Dockerfile .
- docker push $NR_IMAGE
- sed -i '$s/#//' docker/Dockerfile
- docker build --secret=id=gitlab,src=/tmp/token -t $LAT_IMAGE -f docker/Dockerfile .
- docker push $LAT_IMAGE
clients:
stage: build
when: manual
variables:
CLP_IMAGE: $IMAGE:client-prod
CLM_IMAGE: $IMAGE:client-mon
script:
- docker build -t $CLP_IMAGE -f docker/Dockerfile.client .
- docker push $CLP_IMAGE
- docker build --build-arg client=client_mon.py -t $CLM_IMAGE -f docker/Dockerfile.client .
- docker push $CLM_IMAGE