set default version from git

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 26b633d37b)
Signed-off-by: Tibor Vass <tibor@docker.com>
This commit is contained in:
Tonis Tiigi 2021-03-05 14:34:32 -08:00 committed by Tibor Vass
parent 84cc7d87cc
commit 8bc4062fc0
1 changed files with 1 additions and 1 deletions

View File

@ -4,7 +4,7 @@ set -eu
TARGET=${TARGET:-"build"}
PLATFORM=${PLATFORM:-}
VERSION=${VERSION:-"unknown-version"}
VERSION=${VERSION:-$(git describe --match 'v[0-9]*' --dirty='.m' --always --tags | sed 's/^v//' 2>/dev/null || echo "unknown-version" )}
GITCOMMIT=${GITCOMMIT:-$(git rev-parse --short HEAD 2> /dev/null || true)}
BUILDTIME=${BUILDTIME:-$(date -u +"%Y-%m-%dT%H:%M:%SZ")}