-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
64 lines (55 loc) · 1.36 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
variables:
DOCKER_HOST: tcp://docker:2375/
QUANTUM_CLI: registry.internal.planetary-networks.de/quantum-public/cli:2
QUANTUM_ENDPOINT: sva-services
stages:
- build
- tag
- predeploy
- deploy
services:
- docker:19.03.0-dind
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
.docker-build: &docker-build
stage: build
script:
- docker pull $IMAGE:latest || true
- docker build --cache-from $IMAGE:latest --tag $IMAGE:$CI_COMMIT_SHA --tag $IMAGE:latest -f $DOCKERFILE .
- docker push $IMAGE:$CI_COMMIT_SHA
- docker push $IMAGE:latest
.quantum-conf: &quantum-conf
stage: predeploy
image:
name: docker/compose:1.25.0
cache:
key: "${CI_PIPELINE_ID}-${PROJECT}"
paths: [quantum.yaml]
script:
- docker-compose -f docker-compose.yml -f stack.yml config > quantum.yaml
only:
- master
.deploy: &deploy
stage: deploy
image: $QUANTUM_CLI
cache:
key: "${CI_PIPELINE_ID}-${PROJECT}"
paths: [quantum.yaml]
script:
- quantum-cli stack update --create --stack $PROJECT-$QUANTUM_ENDPOINT --wait
tags: [v2]
only:
- master
build-app:
variables:
IMAGE: $CI_REGISTRY_IMAGE
DOCKERFILE: Dockerfile
<<: *docker-build
app-conf:
<<: *quantum-conf
variables:
PROJECT: bb-bad-belzig-tmb-importer
deploy:
<<: *deploy
variables:
PROJECT: bb-bad-belzig-tmb-importer