Skip to content

Commit

Permalink
'make build' injects git commit as kpt version (#3085)
Browse files Browse the repository at this point in the history
  • Loading branch information
droot committed May 4, 2022
1 parent 9a8998a commit 840e7a1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
.PHONY: docs license fix vet fmt lint test build tidy

GOBIN := $(shell go env GOPATH)/bin
GIT_COMMIT := $(shell git rev-parse --short HEAD)

# T refers to an e2e test case matcher. This enables running e2e tests
# selectively. For example,
Expand All @@ -27,7 +28,7 @@ T ?= ".*"
all: generate license fix vet fmt lint license-check test build buildall tidy

build:
go build -o $(GOBIN)/kpt -v .
go build -ldflags "-X github.com/GoogleContainerTools/kpt/run.version=${GIT_COMMIT}" -o $(GOBIN)/kpt -v .

buildall:
GOOS=windows go build -o /dev/null
Expand Down

0 comments on commit 840e7a1

Please sign in to comment.