Changeset - 97757028d2ab
[Not reviewed]
1 0 1
Ben Stevens - 5 years ago 2019-06-17 12:55:39
benjamin.stevens.au@gmail.com
Addition of 'release/' branch logic
1 file changed with 32 insertions and 0 deletions:
0 comments (0 inline, 0 general)
.gitlab-ci.yml
Show inline comments
 
file renamed from .gitlab-ci-disabled.yml to .gitlab-ci.yml
 
variables:
 
  CONTAINER_IMAGE_2019: "asia.gcr.io/linuxconfsydney/symposion_app_2019"
 
  CONTAINER_IMAGE_FROM_DEV: "asia.gcr.io/linuxconfsydney/symposion_app_${CI_COMMIT_REF_NAME#dev/}"
 
  CONTAINER_IMAGE_FROM_RELEASE: "asia.gcr.io/linuxconfsydney/symposion_app_${CI_COMMIT_REF_NAME#release/}"
 
  NAMESPACE_FROM_RELEASE: "lca${CI_COMMIT_REF_NAME#release/}-prod"
 
  DOCKER_DRIVER: overlay2
 

	
 
build_image:
...
 
@@ -20,6 +23,19 @@ build_image:
 
  only:
 
    - master
 

	
 
build_release_image:
 
  image: docker:git
 
  stage: build
 
  services:
 
  - docker:dind
 
  script:
 
  - docker build -f docker/Dockerfile -t ${CONTAINER_IMAGE_FROM_RELEASE}:latest -t ${CONTAINER_IMAGE_FROM_RELEASE}:$CI_COMMIT_SHA .
 
  - docker login -u _json_key -p "$GOOGLE_KEY" https://asia.gcr.io
 
  - docker push ${CONTAINER_IMAGE_FROM_RELEASE}:$CI_COMMIT_SHA
 
  - docker push ${CONTAINER_IMAGE_FROM_RELEASE}:latest
 
  only:
 
    - /^release\/.*$/
 

	
 
k8s-prod-deploy:
 
  image: google/cloud-sdk
 
  stage: deploy
...
 
@@ -72,6 +88,22 @@ build_2019_image:
 
    - "master"
 

	
 

	
 
deploy-release:
 
  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=${NAMESPACE_FROM_RELEASE} --user=gitlab-ci
 
  - kubectl config use-context cluster
 
  - kubectl --token "${GL_KUBE_TOKEN}" set image deployment/symposion-app symposion-app="${CONTAINER_IMAGE_FROM_RELEASE}":$CI_COMMIT_SHA
 
  only:
 
  - /^release\/.*$/
 
  environment:
 
    name: 2020/prod
 
    url: https://2020.linux.conf.au
 

	
 

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