add version from git tag

This commit is contained in:
rob boll 2017-04-12 11:13:51 -04:00
parent 5cbf194ee4
commit 709195848a
2 changed files with 7 additions and 5 deletions

View File

@ -22,7 +22,7 @@ test:
.PHONY: test
cross:
gox -os '!freebsd !netbsd' -arch '!arm' -output "dist/{{.Dir}}_{{.OS}}_{{.Arch}}" ${TARGETS}
gox -os '!freebsd !netbsd' -arch '!arm' -output "dist/{{.Dir}}_{{.OS}}_{{.Arch}}" -ldflags '-X main.Version=${TAG}' ${TARGETS}
.PHONY: cross
pristine: generate fmt

View File

@ -16,12 +16,14 @@ const (
helmfile = "charts.yaml"
)
var Version string
func main() {
app := cli.NewApp()
app.Name = "helmfile"
app.Usage = ""
app.Version = "0.1.0"
app.Version = Version
app.Flags = []cli.Flag{
cli.StringFlag{
Name: "file, f",