1
0
Fork 0

ci: add deploy dry run and deploy jobs to production

This commit is contained in:
Vojtěch Mareš 2023-07-04 21:19:06 +02:00
parent 5e46503a3a
commit 595fc73364
Signed by: vojtech.mares
GPG key ID: C6827B976F17240D
2 changed files with 62 additions and 0 deletions

View file

@ -41,6 +41,32 @@ deploy:staging:dry-run:
- if: $CI_COMMIT_BRANCH == "main" - if: $CI_COMMIT_BRANCH == "main"
when: always when: always
deploy:production:dry-run:
stage: deploy:dry-run
script:
- >
helm \
upgrade \
--install \
--atomic \
--wait=true \
--wait-for-jobs=true \
--timeout=900s \
--dry-run=true \
--namespace backoffice-production \
--values ./charts/backoffice/values.production.yaml \
--set image.tag=$CI_COMMIT_BRANCH-$CI_COMMIT_SHORT_SHA \
--set dockerconfigjsonBase64=dummy \
--set backoffice.secrets.databaseURL=dummy \
--set backoffice.secrets.nextauthSecret=dummy \
--set backoffice.secrets.googleClientID=dummy \
--set backoffice.secrets.googleClientSecret=dummy \
backoffice \
./charts/backoffice
rules:
- if: $CI_COMMIT_BRANCH == "production"
when: always
deploy:staging: deploy:staging:
stage: deploy stage: deploy
script: script:
@ -68,3 +94,31 @@ deploy:staging:
rules: rules:
- if: $CI_COMMIT_BRANCH == "main" - if: $CI_COMMIT_BRANCH == "main"
when: always when: always
deploy:production:
stage: deploy
script:
- >
helm \
upgrade \
--install \
--atomic \
--wait=true \
--wait-for-jobs=true \
--timeout=900s \
--namespace backoffice-production \
--values ./charts/backoffice/values.production.yaml \
--set image.tag=$CI_COMMIT_BRANCH-$CI_COMMIT_SHORT_SHA \
--set dockerconfigjsonBase64=$DOCKERCONFIG_BASE64 \
--set backoffice.secrets.databaseURL=$DATABASE_URL \
--set backoffice.secrets.nextauthSecret=$NEXTAUTH_SECRET \
--set backoffice.secrets.googleClientID=$GOOGLE_CLIENT_ID \
--set backoffice.secrets.googleClientSecret=$GOOGLE_CLIENT_SECRET \
backoffice \
./charts/backoffice
environment:
name: production
url: https://backoffice.mareshq.com
rules:
- if: $CI_COMMIT_BRANCH == "production"
when: always

View file

@ -0,0 +1,8 @@
ingress:
enabled: true
host: backoffice.mareshq.com
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
backoffice:
env: production