This repository has been archived by the owner on Dec 2, 2021. It is now read-only.
forked from OpenHCS/apps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
74 lines (70 loc) · 2.25 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
stages:
- build
- deploy
image: docker:19.03.0
services:
- docker:19.03.0-dind
## Production
build-apps-production:
variables:
DOCKER_DRIVER: "overlay2"
DOCKER_TLS_CERTDIR: ""
REGISTRY: "registry.sofort-impfen.de"
IMAGE_SPACE: "registry.sofort-impfen.de/si/apps"
stage: build
before_script:
- docker login --username gitlab+deploy-token-6 --password $LOGIN_PASSPHRASE $REGISTRY
script:
- rm -rf .git
- docker build --build-arg CI_COMMIT_SHA=${CI_COMMIT_SHA} --build-arg ENVIRONMENT=prod -t "${IMAGE_SPACE}/sofort-impfen-apps:${CI_COMMIT_SHORT_SHA}" -t "${IMAGE_SPACE}/sofort-impfen-apps:latest" .
- docker push "${IMAGE_SPACE}/sofort-impfen-apps:${CI_COMMIT_SHORT_SHA}"
- docker push "${IMAGE_SPACE}/sofort-impfen-apps:latest"
only:
refs:
- master
- main
deploy-apps-production:
environment: production
image: alpine:latest
stage: deploy
before_script:
- apk add curl
script:
- curl -X POST "https://rundeck.sofort-impfen.de/api/19/job/d96f307f-f974-4504-9bdf-65094a0bdc66/run?authtoken=${RUNDECK_TOKEN}" --header "Content-Type:text/xml"
variables:
GIT_STRATEGY: none
only:
refs:
- master
- main
## Staging
build-apps-staging:
variables:
DOCKER_DRIVER: "overlay2"
DOCKER_TLS_CERTDIR: ""
REGISTRY: "registry.sofort-impfen.de"
IMAGE_SPACE: "registry.sofort-impfen.de/si/apps"
stage: build
before_script:
- docker login --username gitlab+deploy-token-6 --password $LOGIN_PASSPHRASE $REGISTRY
script:
- rm -rf .git
- docker build --build-arg CI_COMMIT_SHA=${CI_COMMIT_SHA} --build-arg ENVIRONMENT=staging -t "${IMAGE_SPACE}/sofort-impfen-apps:${CI_COMMIT_SHORT_SHA}" -t "${IMAGE_SPACE}/sofort-impfen-apps:staging" .
- docker push "${IMAGE_SPACE}/sofort-impfen-apps:${CI_COMMIT_SHORT_SHA}"
- docker push "${IMAGE_SPACE}/sofort-impfen-apps:staging"
only:
refs:
- staging
deploy-apps-staging:
environment: staging
image: alpine:latest
stage: deploy
before_script:
- apk add curl
script:
- curl -X POST "https://rundeck.sofort-impfen.de/api/19/job/f88ca224-ed98-4908-8ebd-ac2bd141b2d1/run?authtoken=${RUNDECK_TOKEN}" --header "Content-Type:text/xml"
variables:
GIT_STRATEGY: none
only:
refs:
- staging