File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -4,19 +4,16 @@ SERVER_BINARY = dblab-server
44CLI_BINARY = dblab
55GOARCH = amd64
66
7- VERSION? =0.3.1
7+ COMMIT? = $( shell git rev-parse HEAD)
88BUILD_TIME? =$(shell date -u '+% Y% m% d-% H% M')
9- COMMIT? =no # $(shell git rev-parse HEAD)
10- BRANCH?=no # $(shell git rev-parse --abbrev-ref HEAD)
9+ VERSION =$(shell git describe --tags 2>/dev/null || echo "${COMMIT}")
1110
1211# Symlink into GOPATH
1312BUILD_DIR =${GOPATH}/${SERVER_BINARY}
1413
1514# Setup the -ldflags option for go build here, interpolate the variable values
1615LDFLAGS = -ldflags "-s -w \
1716 -X gitlab.com/postgres-ai/database-lab/version.version=${VERSION} \
18- -X main.commit=${COMMIT} \
19- -X main.branch=${BRANCH}\
2017 -X gitlab.com/postgres-ai/database-lab/version.buildTime=${BUILD_TIME}"
2118
2219# Go tooling command aliases
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ import (
2626 "gitlab.com/postgres-ai/database-lab/pkg/services/platform"
2727 "gitlab.com/postgres-ai/database-lab/pkg/services/provision"
2828 "gitlab.com/postgres-ai/database-lab/pkg/srv"
29+ "gitlab.com/postgres-ai/database-lab/version"
2930)
3031
3132var opts struct {
@@ -39,6 +40,8 @@ var opts struct {
3940}
4041
4142func main () {
43+ log .Msg ("Database Lab version: " , version .GetVersion ())
44+
4245 // Load CLI options.
4346 if _ , err := parseArgs (); err != nil {
4447 if flags .WroteHelp (err ) {
You can’t perform that action at this time.
0 commit comments