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:
@@ -244,7 +244,11 @@ unbound_release_tag:
|
||||
- 'apk add --no-cache git jq curl'
|
||||
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 '')"
|
||||
if [[ -n "${LATEST}" && "${VERSION}" == "${LATEST}" ]]; then
|
||||
echo "Version ${VERSION} already exists"
|
||||
|
||||
Reference in New Issue
Block a user