69 lines
1.8 KiB
YAML
69 lines
1.8 KiB
YAML
image: docker:19.03.1
|
|
|
|
variables:
|
|
DOCKER_HOST: tcp://localhost:2375
|
|
DOCKER_TLS_CERTDIR: ''
|
|
IMAGE_TAG: eu.gcr.io/vnc-development/vnc-hybridauth-api:development-$CI_COMMIT_SHORT_SHA
|
|
IMAGE_TAG_PROD: eu.gcr.io/vnc-dev-275609/vnc-hybridauth-api:production-$CI_COMMIT_SHORT_SHA
|
|
IMAGE_TAG_STABLE: eu.gcr.io/vnc-stable/vnc-hybridauth-api:stable-$CI_COMMIT_SHORT_SHA
|
|
|
|
services:
|
|
- docker:19.03.1-dind
|
|
|
|
stages:
|
|
- build_docker
|
|
- notification
|
|
|
|
dev_deploy:
|
|
before_script:
|
|
- base64 -d $SA_Development | docker login -u _json_key --password-stdin https://eu.gcr.io
|
|
stage: build_docker
|
|
script:
|
|
- cd docker
|
|
- docker build -t $IMAGE_TAG .
|
|
- docker push $IMAGE_TAG
|
|
only:
|
|
- master
|
|
|
|
prod_deploy:
|
|
before_script:
|
|
- base64 -d $SA_Production | docker login -u _json_key --password-stdin https://eu.gcr.io
|
|
stage: build_docker
|
|
script:
|
|
- docker pull $IMAGE_TAG
|
|
- docker tag $IMAGE_TAG $IMAGE_TAG_PROD
|
|
- docker push $IMAGE_TAG_PROD
|
|
only:
|
|
- /prod_v.*/
|
|
|
|
stable_deploy:
|
|
before_script:
|
|
- base64 -d $SA_Production | docker login -u _json_key --password-stdin https://eu.gcr.io
|
|
stage: build_docker
|
|
script:
|
|
- docker pull $IMAGE_TAG
|
|
- docker tag $IMAGE_TAG $IMAGE_TAG_STABLE
|
|
- docker push $IMAGE_TAG_STABLE
|
|
only:
|
|
- /stable_v.*/
|
|
|
|
successful-results:
|
|
image: eu.gcr.io/vnc-development/docker-vnc-deb-builder:latest
|
|
stage: notification
|
|
script:
|
|
- echo "SUCCESS" > result.txt
|
|
- ./tools/nagnotify.sh || echo "done"
|
|
rules:
|
|
- if: '$CI_COMMIT_BRANCH == "master"'
|
|
when: on_success
|
|
|
|
failed-results:
|
|
image: eu.gcr.io/vnc-development/docker-vnc-deb-builder:latest
|
|
stage: notification
|
|
script:
|
|
- echo "FAILURE" > result.txt
|
|
- ./tools/nagnotify.sh || echo "done"
|
|
rules:
|
|
- if: '$CI_COMMIT_BRANCH == "master"'
|
|
when: on_failure
|