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
4
4
CLI_BINARY = dblab
5
5
GOARCH = amd64
6
6
7
- VERSION? =0.3.1
7
+ COMMIT? = $( shell git rev-parse HEAD)
8
8
BUILD_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}")
11
10
12
11
# Symlink into GOPATH
13
12
BUILD_DIR =${GOPATH}/${SERVER_BINARY}
14
13
15
14
# Setup the -ldflags option for go build here, interpolate the variable values
16
15
LDFLAGS = -ldflags "-s -w \
17
16
-X gitlab.com/postgres-ai/database-lab/version.version=${VERSION} \
18
- -X main.commit=${COMMIT} \
19
- -X main.branch=${BRANCH}\
20
17
-X gitlab.com/postgres-ai/database-lab/version.buildTime=${BUILD_TIME}"
21
18
22
19
# Go tooling command aliases
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ import (
26
26
"gitlab.com/postgres-ai/database-lab/pkg/services/platform"
27
27
"gitlab.com/postgres-ai/database-lab/pkg/services/provision"
28
28
"gitlab.com/postgres-ai/database-lab/pkg/srv"
29
+ "gitlab.com/postgres-ai/database-lab/version"
29
30
)
30
31
31
32
var opts struct {
@@ -39,6 +40,8 @@ var opts struct {
39
40
}
40
41
41
42
func main () {
43
+ log .Msg ("Database Lab version: " , version .GetVersion ())
44
+
42
45
// Load CLI options.
43
46
if _ , err := parseArgs (); err != nil {
44
47
if flags .WroteHelp (err ) {
You can’t perform that action at this time.
0 commit comments