From e35fc5616334dba879a3a5d73ce390a506aacfaa Mon Sep 17 00:00:00 2001 From: Alec Turner Date: Thu, 11 Apr 2024 11:43:26 -0700 Subject: [PATCH] Explicitly set version hash to use 7 characters While 7 is the default number of characters used to abbreviate a commit hash, this is not (by default) constant and different instances of the same repo may generate different version strings as a result. This commit sets this length explicitly to 7 in both package.sh and build-image scripts. --- docker/build-image | 2 +- package.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/build-image b/docker/build-image index d27465c1..d5f66a36 100755 --- a/docker/build-image +++ b/docker/build-image @@ -60,7 +60,7 @@ if [ -z $VERSION_NAME ];then VERSION_NAME="$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA" # if not ci, try to use git elif command -v git &> /dev/null; then - VERSION_NAME=$(git describe --always --tags --dirty) + VERSION_NAME=$(git describe --always --tags --abbrev=7 --dirty) # fallback else VERSION_NAME="latest" diff --git a/package.sh b/package.sh index 5ed3e541..0595360b 100755 --- a/package.sh +++ b/package.sh @@ -21,7 +21,7 @@ elif [ $CI_COMMIT_BRANCH ]; then VERSION_NAME="$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA" # if not ci, try to use git elif command -v git &> /dev/null; then - VERSION_NAME=$(git describe --always --tags --dirty) + VERSION_NAME=$(git describe --always --tags --abbrev=7 --dirty) # fallback else VERSION_NAME="latest"