aboutsummaryrefslogtreecommitdiffstats
path: root/client/go/Makefile
diff options
context:
space:
mode:
authorMartin Polden <mpolden@mpolden.no>2021-09-06 14:18:44 +0200
committerMartin Polden <mpolden@mpolden.no>2021-09-06 14:57:52 +0200
commitc8b11445da94fb727f1e9b72afb3ee379c9ce968 (patch)
tree3890f33107e40cba57244e78d7de4664cabdc157 /client/go/Makefile
parent9c939c04b9b2ec4ed2d74c33ebc580ff81198e60 (diff)
Add version command
Diffstat (limited to 'client/go/Makefile')
-rw-r--r--client/go/Makefile7
1 files changed, 6 insertions, 1 deletions
diff --git a/client/go/Makefile b/client/go/Makefile
index db16b495b74..abda68427e4 100644
--- a/client/go/Makefile
+++ b/client/go/Makefile
@@ -2,8 +2,13 @@
all: test checkfmt install
+# When building a new release the build system should set the VERSION
+# environment variable to version being built
+VERSION ?= $(shell echo "0.0.0-`git rev-parse --short HEAD`")
+
install:
- env GOBIN=$(PWD)/bin go install ./...
+ env GOBIN=$(PWD)/bin \
+ go install -ldflags "-X github.com/vespa-engine/vespa/client/go/build.Version=$(VERSION)" ./...
test:
go test ./...