File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 55GOBIN =$(shell go env GOBIN)
66endif
77
8+ # Version from git tags
9+ VERSION ?= 0.0.0
10+ LDFLAGS ?= -X 'main.version=$(VERSION ) '
11+
812# Setting SHELL to bash allows bash commands to be executed by recipes.
913# Options are set to exit when a recipe line exits non-zero or a piped command fails.
1014SHELL = /usr/bin/env bash -o pipefail
@@ -78,7 +82,7 @@ test-e2e: build ## Run e2e tests.
7882
7983.PHONY : build
8084build : # # Build binary.
81- GOOS=$(GOOS ) go build -o $(LOCALBIN ) / ./cmd/...
85+ GOOS=$(GOOS ) go build -ldflags= " $( LDFLAGS ) " - o $(LOCALBIN ) / ./cmd/...
8286
8387.PHONY : run
8488run : build # # Run binary.
Original file line number Diff line number Diff line change @@ -9,9 +9,14 @@ import (
99 "github.com/awslabs/amazon-eks-ami/nodeadm/internal/cli"
1010)
1111
12+ var (
13+ version = "0.0.0"
14+ )
15+
1216func main () {
1317 flaggy .SetName ("nodeadm" )
1418 flaggy .SetDescription ("From zero to Node faster than you can say Elastic Kubernetes Service" )
19+ flaggy .SetVersion (version )
1520 flaggy .DefaultParser .AdditionalHelpPrepend = "\n http://github.com/awslabs/amazon-eks-ami/nodeadm"
1621 flaggy .DefaultParser .ShowHelpOnUnexpected = true
1722
You can’t perform that action at this time.
0 commit comments