Skip to content

Commit

Permalink
Makefile: use git describe to assign PDReleaseVersion (#848)
Browse files Browse the repository at this point in the history
  • Loading branch information
disksing authored Nov 13, 2017
1 parent ea9fb36 commit 9ad56b4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ TEST_PKGS := $(shell find . -iname "*_test.go" -exec dirname {} \; | \
GOFILTER := grep -vE 'vendor|testutil'
GOCHECKER := $(GOFILTER) | awk '{ print } END { if (NR > 0) { exit 1 } }'

LDFLAGS += -X "$(PD_PKG)/server.PDReleaseVersion=$(shell git describe --tags --dirty)"
LDFLAGS += -X "$(PD_PKG)/server.PDBuildTS=$(shell date -u '+%Y-%m-%d %I:%M:%S')"
LDFLAGS += -X "$(PD_PKG)/server.PDGitHash=$(shell git rev-parse HEAD)"
LDFLAGS += -X "$(PD_PKG)/server.PDGitBranch=$(shell git rev-parse --abbrev-ref HEAD)"
Expand Down
2 changes: 1 addition & 1 deletion server/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const (

// Version information.
var (
PDReleaseVersion = "1.0.0"
PDReleaseVersion = "None"
PDBuildTS = "None"
PDGitHash = "None"
PDGitBranch = "None"
Expand Down

0 comments on commit 9ad56b4

Please sign in to comment.