From b2df55e9d7c17b59515de51129b0d80e71b83cbd Mon Sep 17 00:00:00 2001 From: Donny Xia Date: Mon, 2 Nov 2020 09:52:23 -0800 Subject: [PATCH] update version in image creation --- releasing/cloudbuild_kustomize_image.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/releasing/cloudbuild_kustomize_image.yaml b/releasing/cloudbuild_kustomize_image.yaml index 2311e3444..aa81f4ca3 100644 --- a/releasing/cloudbuild_kustomize_image.yaml +++ b/releasing/cloudbuild_kustomize_image.yaml @@ -9,6 +9,7 @@ steps: - "PROJECT_ID=$PROJECT_ID" - "_GIT_TAG=$_GIT_TAG" - "_PULL_BASE_REF=$_PULL_BASE_REF" + - "_VERSION=$_VERSION" # We need to use bash to configure the build date properly. - name: "gcr.io/cloud-builders/docker" entrypoint: /bin/bash @@ -21,10 +22,12 @@ steps: gcr.io/$PROJECT_ID/kustomize:${_GIT_TAG} -t gcr.io/$PROJECT_ID/kustomize:latest + -t + gcr.io/$PROJECT_ID/kustomize:${_PULL_BASE_REF#*/} -f kustomize.Dockerfile --build-arg - VERSION=${_VERSION} + VERSION=${_PULL_BASE_REF#*/} --build-arg COMMIT=$(git rev-parse HEAD) --build-arg @@ -42,7 +45,7 @@ substitutions: # _PULL_BASE_REF will contain the ref that was pushed to to trigger this build - # a branch like 'master' or 'release-0.2', or a tag like 'v0.2'. _PULL_BASE_REF: "master" - _VERSION: ${_PULL_BASE_REF#*/} + # Other substitutions will not be evaluated options: substitution_option: ALLOW_LOOSE