From 6d24b712a35037152dd04afe0f4dd01f313481d0 Mon Sep 17 00:00:00 2001 From: Tyler Ward Date: Tue, 5 Feb 2019 10:44:00 -0800 Subject: [PATCH] #841 - disable git_sha injection by default, allow override from .lagoon.yml --- images/oc-build-deploy-dind/build-deploy.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/images/oc-build-deploy-dind/build-deploy.sh b/images/oc-build-deploy-dind/build-deploy.sh index 94f65af9b9..19f24e1dda 100755 --- a/images/oc-build-deploy-dind/build-deploy.sh +++ b/images/oc-build-deploy-dind/build-deploy.sh @@ -18,7 +18,13 @@ else /oc-build-deploy/scripts/git-checkout-pull.sh "$SOURCE_REPOSITORY" "$GIT_REF" fi -LAGOON_GIT_SHA=`git rev-parse HEAD` +INJECT_GIT_SHA=$(cat .lagoon.yml | shyaml get-value environment_variables.git_sha false) +if [ "$INJECT_GIT_SHA" == "true" ] +then + LAGOON_GIT_SHA=`git rev-parse HEAD` +else + LAGOON_GIT_SHA="0000000000000000" +fi if [[ -n "$SUBFOLDER" ]]; then cd $SUBFOLDER