feat: cmd version use short commitid (#291)

This commit is contained in:
naison
2024-07-05 22:21:19 +08:00
committed by GitHub
parent 993be34b70
commit 5f0fe6668a
2 changed files with 2 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
VERSION ?= $(shell git tag -l --sort=v:refname | tail -1)
GIT_COMMIT ?= $(shell git describe --match=NeVeRmAtCh --always --abbrev=40)
GIT_COMMIT ?= $(shell git describe --match=NeVeRmAtCh --always --abbrev=7)
BUILD_TIME ?= $(shell date +"%Y-%m-%dT%H:%M:%SZ")
BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)

View File

@@ -42,7 +42,7 @@ func CmdVersion(cmdutil.Factory) *cobra.Command {
Run: func(cmd *cobra.Command, args []string) {
fmt.Printf("KubeVPN: CLI\n")
fmt.Printf(" Version: %s\n", config.Version)
fmt.Printf(" DaemonVersion: %s\n", getDaemonVersion())
fmt.Printf(" Daemon: %s\n", getDaemonVersion())
fmt.Printf(" Image: %s\n", config.Image)
fmt.Printf(" Branch: %s\n", Branch)
fmt.Printf(" Git commit: %s\n", config.GitCommit)