Refine version number

Signed-off-by: pixiake <guofeng@yunify.com>
This commit is contained in:
pixiake 2020-09-21 11:38:23 +08:00
parent 0c5c3586ca
commit a6e392b1ed
3 changed files with 8 additions and 2 deletions

View File

@ -6,11 +6,14 @@ GIT_TAG = $(shell git describe --tags --abbrev=0 --exact-match 2>/dev/null)
GIT_DIRTY = $(shell test -n "`git status --porcelain`" && echo "dirty" || echo "clean")
VERSION_METADATA = unreleased
VERSION = latest
# Clear the "unreleased" string in BuildMetadata
ifneq ($(GIT_TAG),)
VERSION_METADATA =
VERSION = ${GIT_TAG}
endif
LDFLAGS += -X github.com/kubesphere/kubekey/version.version=${VERSION}
LDFLAGS += -X github.com/kubesphere/kubekey/version.metadata=${VERSION_METADATA}
LDFLAGS += -X github.com/kubesphere/kubekey/version.gitCommit=${GIT_COMMIT}
LDFLAGS += -X github.com/kubesphere/kubekey/version.gitTreeState=${GIT_DIRTY}

View File

@ -8,13 +8,16 @@ GIT_DIRTY=$(test -n "`git status --porcelain`" && echo "dirty" || echo "clean")
VERSION_METADATA=unreleased
VERSION=latest
# Clear the "unreleased" string in BuildMetadata
if [[ -n $GIT_TAG ]]
then
VERSION_METADATA=
VERSION=${GIT_TAG}
fi
LDFLAGS="-X github.com/kubesphere/kubekey/version.metadata=${VERSION_METADATA}
LDFLAGS="-X github.com/kubesphere/kubekey/version.version=${VERSION}
-X github.com/kubesphere/kubekey/version.metadata=${VERSION_METADATA}
-X github.com/kubesphere/kubekey/version.gitCommit=${GIT_COMMIT}
-X github.com/kubesphere/kubekey/version.gitTreeState=${GIT_DIRTY}"

View File

@ -26,7 +26,7 @@ var (
//
// Increment major number for new feature additions and behavioral changes.
// Increment minor number for bug fixes and performance enhancements.
version = "v1.0.1"
version = "latest"
// metadata is extra build time data
metadata = ""