From 0eb73ee5bf518b7c7af861d6f9ca7fd04aa5aad1 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Thu, 21 Nov 2024 00:53:19 +0100 Subject: [PATCH] CI: Improve version detection on building doc --- .gitlab-ci.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2002fa63..2f0d57cd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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"