From 3d757cbbfebf3fc2f0f131d68641556b91925bba Mon Sep 17 00:00:00 2001 From: Hari Sekhon Date: Thu, 22 Apr 2021 15:44:03 +0100 Subject: [PATCH] updated gcp_ci_deploy_k8s.sh --- gcp_ci_deploy_k8s.sh | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/gcp_ci_deploy_k8s.sh b/gcp_ci_deploy_k8s.sh index 5e8e12d5..2d2554c5 100755 --- a/gcp_ci_deploy_k8s.sh +++ b/gcp_ci_deploy_k8s.sh @@ -50,6 +50,7 @@ usage_args="" # The rest of these should be set by the CI/CD system check_env_defined "APP" check_env_defined "BUILD" +check_env_defined "ENVIRONMENT" check_env_defined "CLOUDSDK_CORE_PROJECT" check_env_defined "CLOUDSDK_COMPUTE_REGION" check_env_defined "GKE_CLUSTER" @@ -82,18 +83,7 @@ gcp_login gke_login "$GKE_CLUSTER" -# BRANCH_NAME is provided via lib.sh for both Jenkins and TeamCity -# git branches (dev / staging / production) should all match the k8s directory structure -# -# for Feature Branch builds using a non-uniform git branch name and non-uniform location on disk, -# simply set the CI/CD environment's working directory for this build instead and this will do nothing -if [ -d "k8s/$BRANCH_NAME" ]; then - cd "k8s/$BRANCH_NAME" -elif ! [ -f kustomization.yaml ] && - [ -d "k8s/dev" ]; then - # if we haven't been set into a $PWD with a kustomization, check for k8s/dev and use it by default - cd "k8s/dev" -fi +cd "k8s/$ENVIRONMENT" replace_latest_with_build "$BUILD"