-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
100 lines (93 loc) · 3.38 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
stages:
- build
- deploy
variables:
# set docker host to connect to docker in kubernetes
DOCKER_HOST: tcp://localhost:2375/
DOCKER_DRIVER: overlay2
# Set correct certs dir to /certs according to this article: https://about.gitlab.com/2019/07/31/docker-in-docker-with-docker-19-dot-03/
DOCKER_TLS_CERTDIR: "/certs"
cache:
key: "lotta-media-conversion-dispatcher-node-modules"
paths:
- node_modules/
build docker image:staging:
stage: build
environment:
name: staging
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"https://index.docker.io/v1/\":{\"auth\":\"$(echo -n "$DOCKER_HUB_USER:$DOCKER_HUB_PASSWORD" | base64)\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination lotta/media-conversion-dispatcher:$CI_COMMIT_SHA
only:
refs:
- develop
build docker image:production:
stage: build
environment:
name: production
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"https://index.docker.io/v1/\":{\"auth\":\"$(echo -n "$DOCKER_HUB_USER:$DOCKER_HUB_PASSWORD" | base64)\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination lotta/media-conversion-dispatcher:$CI_COMMIT_TAG --destination lotta/media-conversion-dispatcher:latest
only:
- tags
deploy:staging:
stage: deploy
environment:
name: staging
image:
name: lotta/ionos-helm-deploy:latest
script:
- /user/local/bin/setup.sh
- helm repo add lotta https://medienportal.gitlab.io/helm-charts
- helm repo update
- helm upgrade --install lotta-media-conversion-dispatcher lotta/lotta-media-conversion-dispatcher
--namespace lotta-staging --wait
--set appEnvironment=production
--set image.tag=${CI_COMMIT_SHA}
--set replicaCount=1
--set sentry.dsn=$SENTRY_DSN
--set coconut.apiKey=$COCONUT_API_KEY
--set rabbitmq.url=$RABBITMQ_URL
--set s3Compat.endpoint=$S3COMPAT_ENDPOINT
--set s3Compat.accessKeyId=$S3COMPAT_ACCESS_KEY_ID
--set s3Compat.secretAccessKey=$S3COMPAT_SECRET_ACCESS_KEY
--set s3Compat.bucket=$S3COMPAT_BUCKET
--set s3Compat.region=$S3COMPAT_REGION
--set s3Compat.cdnBaseUrl=$S3COMPAT_CDN_BASE_URL
only:
refs:
- develop
deploy:production:
stage: deploy
environment:
name: production
image:
name: lotta/ionos-helm-deploy:latest
script:
- /user/local/bin/setup.sh
- helm repo add lotta https://medienportal.gitlab.io/helm-charts
- helm repo update
- helm upgrade --install lotta-media-conversion-dispatcher lotta/lotta-media-conversion-dispatcher
--namespace lotta --wait
--set appEnvironment=production
--set image.tag=${CI_COMMIT_TAG}
--set replicaCount=1
--set sentry.dsn=$SENTRY_DSN
--set coconut.apiKey=$COCONUT_API_KEY
--set rabbitmq.url=$RABBITMQ_URL
--set s3Compat.endpoint=$S3COMPAT_ENDPOINT
--set s3Compat.accessKeyId=$S3COMPAT_ACCESS_KEY_ID
--set s3Compat.secretAccessKey=$S3COMPAT_SECRET_ACCESS_KEY
--set s3Compat.bucket=$S3COMPAT_BUCKET
--set s3Compat.region=$S3COMPAT_REGION
--set s3Compat.cdnBaseUrl=$S3COMPAT_CDN_BASE_URL
only:
- tags