diff --git a/scripts/uibk-release.sh b/scripts/uibk-release.sh index 7b09d1ef06899f1f0e3c2ada1f61ee0ac854fe23..a85df7f6c50c194b2bae45173a176f36c9c669c8 100755 --- a/scripts/uibk-release.sh +++ b/scripts/uibk-release.sh @@ -15,7 +15,10 @@ echo "The last 5 (un)merged uibk tags:" echo "The last 5 merged uibk tags:" /usr/bin/git tag -l --merged HEAD --sort creatordate|grep '\.uibk-'|tail -n 5 -LASTTAG=$(/usr/bin/git tag -l --merged HEAD --sort creatordate|grep '\.uibk-'|tail -n 1) +echo "The last 5 merged uibk tags for this major, minor and patch version:" +/usr/bin/git tag -l --merged HEAD --sort creatordate|grep -F "${CODE_VERSION_MMP}.uibk-"|tail -n 5 + +LASTTAG=$(/usr/bin/git tag -l --merged HEAD --sort creatordate|grep -F "${CODE_VERSION_MMP}.uibk-"|tail -n 1) LASTTAG_VERSION_MMPU=${LASTTAG#*OpenOLAT_} LASTTAG_VERSION_MMP=${LASTTAG_VERSION_MMPU%.uibk*} LASTTAG_VERSION_MM=${LASTTAG_VERSION_MMP%.*} @@ -25,11 +28,8 @@ set -e echo "Checking out the current head as the branch name we are building in:" git checkout -B "$CI_BUILD_REF_NAME" "$CI_BUILD_REF" -echo "Testing that the major and minor version of the last tag are equal to the one in olat.properties" -test "${LASTTAG_VERSION_MM}" = "${CODE_VERSION_MM}" - -echo "Testing that the major and minor version of the last tag are equal to the one in the branch name" -test "${LASTTAG_VERSION_MM}" = "${GIT_REF_VERSION_MM}" +echo "Testing that the major and minor version from olat.properties and the branch name match" +test "${CODE_VERSION_MM}" = "${GIT_REF_VERSION_MM}" echo "Check if the olat.properties patch release is the same as in our last tag" if [[ "$LASTTAG_VERSION_MMP" = "$CODE_VERSION_MMP" ]] @@ -49,7 +49,7 @@ then exit 1 fi -echo "Test if the detached head commit ($CI_COMMIT_SHA) is equal to the release branch ($CI_COMMIT_REF_NAME)" +echo "Test if the detached head commit ($CI_COMMIT_SHA) is equal to the release branch ($CI_COMMIT_REF_NAME)" if git diff --exit-code $CI_COMMIT_SHA origin/$CI_COMMIT_REF_NAME then echo "SHA and REF are equal so we can checkout the branch"