Skip to content

Commit

Permalink
publish version release
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Winther <jippignu@gmail.com>
  • Loading branch information
jippi committed Aug 23, 2019
1 parent 6fe5746 commit cbf063a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ GET_GOOS = $(word 1,$(subst -, ,$1))
GOBUILD ?= $(shell go env GOOS)-$(shell go env GOARCH)
GOFILES_NOVENDOR = $(shell find . -type f -name '*.go' -not -path "./vendor/*")
VETARGS? =-all
GIT_COMMIT := $(shell git describe --tags)
GIT_DIRTY := $(if $(shell git status --porcelain),+CHANGES)
GO_LDFLAGS := "-X main.Version=$(GIT_COMMIT)$(GIT_DIRTY)"

$(BUILD_DIR):
mkdir -p $@
Expand Down Expand Up @@ -43,7 +46,7 @@ vet: fmt
BINARIES = $(addprefix $(BUILD_DIR)/nomad-helper-, $(GOBUILD))
$(BINARIES): $(BUILD_DIR)/nomad-helper-%: $(BUILD_DIR)
@echo "=> building $@ ..."
GOOS=$(call GET_GOOS,$*) GOARCH=$(call GET_GOARCH,$*) CGO_ENABLED=0 go build -o $@
GOOS=$(call GET_GOOS,$*) GOARCH=$(call GET_GOARCH,$*) CGO_ENABLED=0 go build -o $@ -ldflags $(GO_LDFLAGS)

.PHONY: dist
dist: install fmt vet
Expand Down
5 changes: 4 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,14 @@ var filterFlags = []cli.Flag{
},
}

// Version is filled in by the compiler (git tag + changes)
var Version = "local-dev"

func main() {
app := cli.NewApp()
app.Name = "nomad-helper"
app.Usage = "Useful utilties for working with Nomad at scale"
app.Version = "1.0"
app.Version = Version

app.Flags = []cli.Flag{
cli.StringFlag{
Expand Down

0 comments on commit cbf063a

Please sign in to comment.