fix: format version for rpm spec (#15330)

Co-authored-by: QIU Jian <qiujian@yunionyun.com>
This commit is contained in:
Jian Qiu
2022-11-09 00:09:27 +08:00
committed by GitHub
parent 8958913af2
commit 8779cf37f8
+6 -1
View File
@@ -44,7 +44,12 @@ echo "Build root ${BUILDROOT}"
if [ -z "$VERSION" ]; then
TAG=$(git describe --abbrev=0 --tags || echo testing)
VERSION=${TAG/\//-}
VERSION=${VERSION/v/}
if [[ "$VERSION" =~ ^v0. ]]; then
VERSION=${VERSION/v0./}
elif [[ "$VERSION" =~ ^v ]]; then
VERSION=${VERSION/v/}
fi
VERSION=${VERSION//-/.}
fi
RELEASE=`date +"%y%m%d%H"`