From e9753b326f07e8ee0aef183fe674df337a191558 Mon Sep 17 00:00:00 2001 From: Hunter Craft <118154470+hunterckx@users.noreply.github.com> Date: Wed, 4 Dec 2024 09:31:11 -0800 Subject: [PATCH] fix: apply patch for prod deployment version fixes (#4299) (#4300) --- .gitlab/ci.yaml | 10 ++++------ scripts/set-version.sh | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.gitlab/ci.yaml b/.gitlab/ci.yaml index 2b39010a7..83a64fdd4 100644 --- a/.gitlab/ci.yaml +++ b/.gitlab/ci.yaml @@ -1,3 +1,7 @@ +workflow: + rules: + - if: $CI_PIPELINE_SOURCE == 'push' && $CI_COMMIT_BRANCH =~ /^ucsc\// + stages: - build_image - generate_child_yaml @@ -7,12 +11,7 @@ variables: DOCKER_IMAGE: $CI_REGISTRY_IMAGE DOCKER_TAG: $CI_PIPELINE_ID -.on_branch_push: - rules: - - if: $CI_PIPELINE_SOURCE == 'push' && $CI_COMMIT_BRANCH - build_image: - extends: .on_branch_push stage: build_image rules: - if: $CI_COMMIT_BRANCH @@ -23,7 +22,6 @@ build_image: - docker push $DOCKER_IMAGE:$DOCKER_TAG generate_child_yaml: - extends: .on_branch_push stage: generate_child_yaml image: $DOCKER_IMAGE:$DOCKER_TAG script: diff --git a/scripts/set-version.sh b/scripts/set-version.sh index 31272ce33..b495dc805 100755 --- a/scripts/set-version.sh +++ b/scripts/set-version.sh @@ -13,7 +13,7 @@ GIT_HASH=$(git rev-parse HEAD) BUILD_DATE=$(TZ="America/Los_Angeles" date +"%Y-%m-%d %H:%M:%S %Z") # Get the current code version from git -VERSION=$(git tag --points-at HEAD) +VERSION=$(git describe --tags | cut -d- -f1) # Append newline to ensure following lines are separated from existing content echo "" >> "$TARGET_ENV_FILE"