From c7dfc8f65e0ae46bafaf209a9885ce0a8afde517 Mon Sep 17 00:00:00 2001 From: sami-alajrami Date: Tue, 7 May 2019 13:33:28 +0200 Subject: [PATCH] updating prod deploy ci config --- .circleci/config.yml | 32 +------------------ ...s-template.yaml => prime-prod-values.yaml} | 2 +- .circleci/substitute_prime_tag.sh | 14 -------- 3 files changed, 2 insertions(+), 46 deletions(-) rename .circleci/{prime-prod-values-template.yaml => prime-prod-values.yaml} (99%) delete mode 100755 .circleci/substitute_prime_tag.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index eb9951d7e..8bf2e5147 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -269,32 +269,6 @@ jobs: when: on_fail command: .circleci/notify-slack.sh on-PR-merge-to-dev false - create-PR-to-master: - working_directory: ~/project - - docker: - - image: eu.gcr.io/pi-ostelco-prod/github-hub:2.5.0 - - steps: - - checkout - - run: - name: create PR to merge develop into master - command: | - export PRIME_CANARY_TAG=${CIRCLE_SHA1:0:9} - cd .circleci - ./substitute_prime_tag.sh - git config --global user.email "${GIT_USER_EMAIL}" - git config --global user.name "${GIT_USER_NAME}" - git add prime-prod-values.yaml - git commit -m "[ci skip] updating prime canary image tag to the latest built image." - git push https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com/ostelco/ostelco-core.git develop - hub pull-request -m "DEPLOYING ${PRIME_CANARY_TAG} to PROD" -b master - - - run: - name: notify slack on failure - when: on_fail - command: .circleci/notify-slack.sh on-PR-merge-to-dev false - ### JOBS FOR on-PR-merge-to-master PIPELINE update-prod-endpoints: docker: @@ -339,12 +313,11 @@ jobs: name: deploy prime to the prod cluster command: | export GOOGLE_CREDENTIALS=${PI_PROD_CLUSTER_CREDENTIALS} - #export TAG=$(git rev-parse --short=9 origin/circleci-dev) # fragile, gives latest develop commit but that may not be the correct tag! /authenticate.bash helm repo add ostelco https://storage.googleapis.com/pi-ostelco-helm-charts-repo/ helm repo update helm upgrade prime ostelco/prime --version 0.6.1 --install --namespace prod \ - -f .circleci/prime-prod-values.yaml + -f .circleci/prime-prod-values.yaml --set-string canary.tag=${CIRCLE_SHA1:0:9} - run: name: notify slack on failure @@ -379,9 +352,6 @@ workflows: - deploy-to-dev: requires: - update-dev-endpoints - # - create-PR-to-master: - # requires: - # - deploy-to-dev deploy-to-prod: jobs: diff --git a/.circleci/prime-prod-values-template.yaml b/.circleci/prime-prod-values.yaml similarity index 99% rename from .circleci/prime-prod-values-template.yaml rename to .circleci/prime-prod-values.yaml index 8d238585d..15943f8e9 100644 --- a/.circleci/prime-prod-values-template.yaml +++ b/.circleci/prime-prod-values.yaml @@ -154,7 +154,7 @@ canary: # weight: 25 headers: # only route requests with these headers to the canary service x-mode: canary - tag: ${PRIME_CANARY_TAG} + tag: "" cloudsqlProxy: enabled: true diff --git a/.circleci/substitute_prime_tag.sh b/.circleci/substitute_prime_tag.sh deleted file mode 100755 index 172456736..000000000 --- a/.circleci/substitute_prime_tag.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -# This script is used to inject an image tag for PRIME taken from the PRIME_TAG environment variable -# into the prime-prod-values.yaml (the values file used for production deployment of the PRIME helm chart). -# The script is used in the pipeline after new PRIME image is created and before making a PR from develop into master. - -# This script should NOT be used to inject secrets into the values file as this file is version controlled in git. - -rm -f prime-prod-values.yaml temp.yml -( echo "cat <prime-prod-values.yaml"; - cat prime-prod-values-template.yaml; - #echo "EOF"; -) >temp.yml -. temp.yml \ No newline at end of file