Add 2019 prod deploy job

And streamline the names of the other 2019 jobs
This commit is contained in:
James Polley 2018-07-02 01:54:59 +10:00
parent 3810f02904
commit 0c58a94323

View file

@ -51,6 +51,36 @@ build_review_deployment:
- k8s/ingress-patch.json
- k8s/certificate-patch.json
build_2019_image:
image: docker:git
stage: build
services:
- docker:dind
script:
- docker login -u _json_key -p "$GOOGLE_KEY" https://asia.gcr.io
- docker pull "${CONTAINER_IMAGE_2019}":latest || true
- docker build --cache-from "${CONTAINER_IMAGE_2019}":latest -f docker/Dockerfile -t "${CONTAINER_IMAGE_2019}":$CI_COMMIT_SHA .
- docker push "${CONTAINER_IMAGE_2019}":$CI_COMMIT_SHA
except:
- "2019"
- "dev/2019"
2019-prod-deploy:
image: google/cloud-sdk
stage: deploy
script:
- echo "${CA_CERT}" > cert.crt
- kubectl config set-cluster cluster --server="${KUBE_SERVER}" --embed-certs=true --certificate-authority=cert.crt
- kubectl config set-context cluster --cluster=cluster --namespace=lca2019-prod --user=gitlab-ci
- kubectl config use-context cluster
- kubectl --token "${GL_KUBE_TOKEN}" set image deployment/symposion-app symposion-app="${CONTAINER_IMAGE_2019}":$CI_COMMIT_SHA
only:
- "2019"
when: manual
environment:
name: 2019/prod
url: https://2019.linux.conf.au
build_2019_dev_image:
image: docker:git
stage: build
@ -59,16 +89,14 @@ build_2019_dev_image:
script:
- docker login -u _json_key -p "$GOOGLE_KEY" https://asia.gcr.io
- docker pull "${CONTAINER_IMAGE_2019}"_dev:latest || true
- docker build --cache-from "${CONTAINER_IMAGE_2019}"_dev:latest -f docker/Dockerfile -t "${CONTAINER_IMAGE_2019}":$CI_COMMIT_SHA .
- docker build --build-arg CI_COMMIT_SHA=$CI_COMMIT_SHA -f docker/Dockerfile.dev -t "${CONTAINER_IMAGE_2019}"_dev:$CI_COMMIT_SHA .
- docker push "${CONTAINER_IMAGE_2019}":$CI_COMMIT_SHA
- docker build --cache-from "${CONTAINER_IMAGE_2019}"_dev:latest --build-arg CI_COMMIT_SHA=$CI_COMMIT_SHA -f docker/Dockerfile.dev -t "${CONTAINER_IMAGE_2019}"_dev:$CI_COMMIT_SHA .
- docker push "${CONTAINER_IMAGE_2019}"_dev:$CI_COMMIT_SHA
- docker tag "${CONTAINER_IMAGE_2019}"_dev:$CI_COMMIT_SHA "${CONTAINER_IMAGE_2019}"_dev:$CI_COMMIT_REF_SLUG
- docker push "${CONTAINER_IMAGE_2019}"_dev:$CI_COMMIT_REF_SLUG
except:
- master
k8s-2019_dev-deploy:
2019_dev-deploy:
image: google/cloud-sdk
stage: deploy
script:
@ -83,7 +111,7 @@ k8s-2019_dev-deploy:
name: 2019/dev
url: https://dev.lca2019.org
k8s-2019_dev_review-deploy:
2019_review-deploy:
image: google/cloud-sdk
stage: deploy
script:
@ -99,9 +127,9 @@ k8s-2019_dev_review-deploy:
environment:
name: 2019/dev/${CI_COMMIT_REF_SLUG}
url: https://${CI_COMMIT_REF_SLUG}.dev.lca2019.org
on_stop: k8s-2019_dev_review-stop-deploy
on_stop: 2019_review-stop-deploy
k8s-2019_dev_review-stop-deploy:
2019_review-stop-deploy:
image: google/cloud-sdk
stage: deploy
script:
@ -118,7 +146,7 @@ k8s-2019_dev_review-stop-deploy:
url: https://${CI_COMMIT_REF_SLUG}.dev.lca2019.org
action: stop
k8s-2019_staging-deploy:
2019_staging-deploy:
image: google/cloud-sdk
stage: deploy
script: