Add version sub-command (#1389)

Resolves #1369
This commit is contained in:
KUOKA Yusuke 2020-08-01 10:37:34 +09:00 committed by GitHub
parent 9cffef50b0
commit 4fb47a833a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -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:

View File

@ -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)