fix for version release

This commit is contained in:
Trevor Batley 2024-03-11 20:56:30 +11:00
parent 5c4f74da8f
commit 9916c56721

View File

@ -144,13 +144,17 @@ for tag in $OLDTAGS ; do
-H "Authorization: token $GITEAACCESSTOKEN" )
done
# Now create the version and release tag from the specfile
VERSION_RELEASE=`rpm --queryformat '%{version} %{release}\n' --specfile $REPO_NAME.spec`
VERSION_RELEASE_LONG=`rpm --queryformat '%{version} %{release}\n' --specfile $REPO_NAME.spec`
VERSION_RELEASE=${VERSION_RELEASE_LONG%%$'\n'*}
VERSION=${VERSION_RELEASE% *}
REST=${VERSION_RELEASE#* }
RELEASE=${REST#* }
# Release is not reliable - if you run on Rocky it comes back EL8, centos 7 - EL7
# So, we need to just take the build part (first word)
RELEASE=${VERSION_RELEASE#* }
TAG=$VERSION"-"${RELEASE%.*}
if [ $DEBUG ] ; then
echo "VERSION_RELEASE=$VERSION_RELEASE"
echo "VERSION=$VERSION"
echo "RELEASE=$RELEASE"
echo "TAG=$TAG"
fi
git pull
git tag -a $TAG -m "Setting tag to current Version-Release in spec file: $TAG"
git push origin --tag $TAG $QUIET