CI: Improve version detection on building doc

This commit is contained in:
Benjamin Renard 2024-11-21 00:53:19 +01:00
parent 5e17a8ec81
commit 0eb73ee5bf
Signed by: bn8
GPG key ID: 3E2E1CE1907115BC

View file

@ -171,7 +171,11 @@ build:doc:html:
- apk add make git
- git config user.name $GITLAB_USER_NAME
- git config user.email $GITLAB_USER_EMAIL
- VERSION=`git describe --tags`
- |
VERSION=$(
git describe --tags 2> /dev/null || \
echo "0.0-$( git log --oneline|wc -l )-$( git describe --tags --always )"
)
- cd doc
- git fetch origin $DOC_BRANCH
- git rev-parse --verify $DOC_BRANCH && git branch -D $DOC_BRANCH || echo "No existing local git $DOC_BRANCH branch"
@ -236,7 +240,11 @@ build:doc:append_additional_versions:
- apk add git
- git config user.name $GITLAB_USER_NAME
- git config user.email $GITLAB_USER_EMAIL
- VERSION=`git describe --tags`
- |
VERSION=$(
git describe --tags 2> /dev/null || \
echo "0.0-$( git log --oneline|wc -l )-$( git describe --tags --always )"
)
- cd doc
- git fetch origin $DOC_BRANCH
- git rev-parse --verify $DOC_BRANCH && git branch -D $DOC_BRANCH || echo "No existing local git $DOC_BRANCH branch"