fix: update version handling in gitlab-ci configuration

Check for the existence of the version file before reading it. 
If the file is missing, print a message and exit gracefully. 
This change improves the robustness of the CI pipeline by preventing 
errors when the version file is not present.
This commit is contained in:
2025-09-11 13:22:17 +02:00
parent 4730bbdc1f
commit bd237e5297
+5 -1
View File
@@ -244,7 +244,11 @@ unbound_release_tag:
- 'apk add --no-cache git jq curl' - 'apk add --no-cache git jq curl'
script: script:
- | - |
VERSION="$(cat VERSION)" if [ ! -r .version ]; then
echo "Version file not found"
exit 0
fi
VERSION="$(cat .version 2>/dev/null | jq -r '.version')"
LATEST="$(git describe --abbrev=0 --tags 2>/dev/null || echo '')" LATEST="$(git describe --abbrev=0 --tags 2>/dev/null || echo '')"
if [[ -n "${LATEST}" && "${VERSION}" == "${LATEST}" ]]; then if [[ -n "${LATEST}" && "${VERSION}" == "${LATEST}" ]]; then
echo "Version ${VERSION} already exists" echo "Version ${VERSION} already exists"