Fix development versioning
Helm enforces semantic versioning since the 3.5.0 release so we can not
just use the commit id as version.
@@ -4,13 +4,17 @@ if [ -n "$(git status --porcelain --untracked-files=no)" ]; then
DIRTY="-dirty"
fi
-COMMIT=$(git rev-parse --short HEAD)
GIT_TAG=${DRONE_TAG:-$(git tag -l --contains HEAD | head -n 1)}
if [[ -z "$DIRTY" && -n "$GIT_TAG" ]]; then
VERSION=$GIT_TAG
else
- VERSION="${COMMIT}${DIRTY}"
+ # Make sure tags are available in the CI environment
+ readarray -t TAGS < <(git tag -l)
+ if [[ ${#TAGS[@]} == 0 ]]; then
+ git fetch -t
+ fi
+ VERSION="$(git describe --tags)"
fi
if [ -z "$ARCH" ]; then
