Skip to content
Snippets Groups Projects
Commit 1bc23201 authored by User expired's avatar User expired
Browse files

openolat#140: create new tags also when no previous can be found for this major.minor release

parent d44aa8b7
No related branches found
No related tags found
No related merge requests found
...@@ -15,7 +15,10 @@ echo "The last 5 (un)merged uibk tags:" ...@@ -15,7 +15,10 @@ echo "The last 5 (un)merged uibk tags:"
echo "The last 5 merged uibk tags:" echo "The last 5 merged uibk tags:"
/usr/bin/git tag -l --merged HEAD --sort creatordate|grep '\.uibk-'|tail -n 5 /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_MMPU=${LASTTAG#*OpenOLAT_}
LASTTAG_VERSION_MMP=${LASTTAG_VERSION_MMPU%.uibk*} LASTTAG_VERSION_MMP=${LASTTAG_VERSION_MMPU%.uibk*}
LASTTAG_VERSION_MM=${LASTTAG_VERSION_MMP%.*} LASTTAG_VERSION_MM=${LASTTAG_VERSION_MMP%.*}
...@@ -25,11 +28,8 @@ set -e ...@@ -25,11 +28,8 @@ set -e
echo "Checking out the current head as the branch name we are building in:" echo "Checking out the current head as the branch name we are building in:"
git checkout -B "$CI_BUILD_REF_NAME" "$CI_BUILD_REF" 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" echo "Testing that the major and minor version from olat.properties and the branch name match"
test "${LASTTAG_VERSION_MM}" = "${CODE_VERSION_MM}" test "${CODE_VERSION_MM}" = "${GIT_REF_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 "Check if the olat.properties patch release is the same as in our last tag" echo "Check if the olat.properties patch release is the same as in our last tag"
if [[ "$LASTTAG_VERSION_MMP" = "$CODE_VERSION_MMP" ]] if [[ "$LASTTAG_VERSION_MMP" = "$CODE_VERSION_MMP" ]]
...@@ -49,7 +49,7 @@ then ...@@ -49,7 +49,7 @@ then
exit 1 exit 1
fi 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 if git diff --exit-code $CI_COMMIT_SHA origin/$CI_COMMIT_REF_NAME
then then
echo "SHA and REF are equal so we can checkout the branch" echo "SHA and REF are equal so we can checkout the branch"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment