sms-receiver/.gitlab-ci.yml
Pablo Aramburo b639ed5157 [add] Initial commit
Boilerplate + sops encrypted envs
2022-08-22 14:17:56 -06:00

75 lines
1.3 KiB
YAML

image: tiangolo/docker-with-compose
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- pip install docker-auto-labels
stages:
- test
- build
- deploy
tests:
stage: test
script:
- sh ./scripts/test.sh
tags:
- build
- test
build-stag:
stage: build
script:
- TAG=stag FRONTEND_ENV=staging sh ./scripts/build-push.sh
only:
- master
tags:
- build
- test
build-prod:
stage: build
script:
- TAG=prod FRONTEND_ENV=production sh ./scripts/build-push.sh
only:
- production
tags:
- build
- test
deploy-stag:
stage: deploy
script:
- >
DOMAIN=stag.sms-receiver.idle.laziness.rocks
TRAEFIK_TAG=stag.sms-receiver.idle.laziness.rocks
STACK_NAME=stag-sms-receiver-idle-laziness-rocks
TAG=stag
sh ./scripts/deploy.sh
environment:
name: staging
url: https://stag.sms-receiver.idle.laziness.rocks
only:
- master
tags:
- swarm
- stag
deploy-prod:
stage: deploy
script:
- >
DOMAIN=sms-receiver.idle.laziness.rocks
TRAEFIK_TAG=sms-receiver.idle.laziness.rocks
STACK_NAME=sms-receiver-idle-laziness-rocks
TAG=prod
sh ./scripts/deploy.sh
environment:
name: production
url: https://sms-receiver.idle.laziness.rocks
only:
- production
tags:
- swarm
- prod