Changeset - 0c58a9432391
[Not reviewed]
0 1 0
James Polley - 6 years ago 2018-07-01 15:54:59
jp@jamezpolley.com
Add 2019 prod deploy job

And streamline the names of the other 2019 jobs
1 file changed with 36 insertions and 8 deletions:
0 comments (0 inline, 0 general)
.gitlab-ci.yml
Show inline comments
...
 
@@ -53,2 +53,32 @@ build_review_deployment:
 

	
 
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:
...
 
@@ -61,5 +91,3 @@ build_2019_dev_image:
 
    - 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
...
 
@@ -70,3 +98,3 @@ build_2019_dev_image:
 

	
 
k8s-2019_dev-deploy:
 
2019_dev-deploy:
 
  image: google/cloud-sdk
...
 
@@ -85,3 +113,3 @@ k8s-2019_dev-deploy:
 

	
 
k8s-2019_dev_review-deploy:
 
2019_review-deploy:
 
  image: google/cloud-sdk
...
 
@@ -101,5 +129,5 @@ k8s-2019_dev_review-deploy:
 
    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
...
 
@@ -120,3 +148,3 @@ k8s-2019_dev_review-stop-deploy:
 

	
 
k8s-2019_staging-deploy:
 
2019_staging-deploy:
 
  image: google/cloud-sdk
0 comments (0 inline, 0 general)