diff --git a/Makefile b/Makefile index 0d2c3fce..dfdc49fb 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ ORG ?= $(shell basename $(realpath ..)) PKGS := $(shell go list ./... | grep -v /vendor/) build: - go build ${TARGETS} + go build -ldflags '-X github.com/roboll/helmfile/pkg/app/version.Version=${TAG}' ${TARGETS} .PHONY: build generate: diff --git a/main.go b/main.go index 0aed3772..369ad951 100644 --- a/main.go +++ b/main.go @@ -486,6 +486,15 @@ func main() { return run.ListReleases(c) }), }, + { + Name: "version", + Usage: "Show the version for Helmfile.", + ArgsUsage: "[command]", + Action: func(c *cli.Context) error { + cli.ShowVersion(c) + return nil + }, + }, } err := cliApp.Run(os.Args)