From 8bc4062fc0c51e12b93f6b2a99ec885e6221df8d Mon Sep 17 00:00:00 2001 From: Tonis Tiigi Date: Fri, 5 Mar 2021 14:34:32 -0800 Subject: [PATCH] set default version from git Signed-off-by: Tonis Tiigi (cherry picked from commit 26b633d37bb0ff69cd7210ce4004038fb732bf08) Signed-off-by: Tibor Vass --- scripts/build/.variables | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build/.variables b/scripts/build/.variables index ea0e952d29..ece560174a 100755 --- a/scripts/build/.variables +++ b/scripts/build/.variables @@ -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")}