Create status-go API to return a current revision (#804)

Change `BUILD_FLAGS` in Makefile and update `github.com/status-im/status-go/geth/params.VersionMeta` value with the current Git SHA.
This commit is contained in:
Daniel Regeci 2018-04-10 18:36:11 +08:00 committed by Adam Babik
parent 02309e81e9
commit e34af8d6eb
2 changed files with 5 additions and 4 deletions

View File

@ -11,8 +11,9 @@ endif
CGO_CFLAGS=-I/$(JAVA_HOME)/include -I/$(JAVA_HOME)/include/darwin
GOBIN=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))build/bin
GIT_COMMIT := $(shell git rev-parse --short HEAD)
BUILD_FLAGS := $(shell echo "-ldflags '-X main.buildStamp=`date -u '+%Y-%m-%d.%H:%M:%S'` -X main.gitCommit=$(git rev-parse HEAD)'")
BUILD_FLAGS := $(shell echo "-ldflags '-X main.buildStamp=`date -u '+%Y-%m-%d.%H:%M:%S'` -X main.gitCommit=$(GIT_COMMIT) -X github.com/status-im/status-go/geth/params.VersionMeta=$(GIT_COMMIT)'")
GO ?= latest
XGOVERSION ?= 1.9.2

View File

@ -13,10 +13,10 @@ const (
// VersionPatch is a patch version component of the current release
VersionPatch = 9
// VersionMeta is metadata to append to the version string
VersionMeta = "unstable"
)
// VersionMeta is metadata to append to the version string
var VersionMeta string // rely on linker: -ldflags -X github.com/status-im/status-go/geth/params.VersionMeta"
// Version exposes string representation of program version.
var Version = fmt.Sprintf("%d.%d.%d-%s", VersionMajor, VersionMinor, VersionPatch, VersionMeta)