This repository was archived by the owner on Jun 23, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -16,8 +16,10 @@ BIN := oci
16
16
BUILD_DIR := dist
17
17
BIN_DIR := ${BUILD_DIR}/bin
18
18
19
+ BUILD := $(shell git describe --always --dirty)
19
20
# Allow overriding for release versions
20
- VERSION ?= $(shell git describe --always --dirty)
21
+ # Else just equal the build (git hash)
22
+ VERSION ?= ${BUILD}
21
23
GOOS ?= linux
22
24
GOARCH ?= amd64
23
25
55
57
go build \
56
58
-i \
57
59
-v \
58
- -ldflags=" -s -w -X main.version=${VERSION} " \
60
+ -ldflags=" -s -w -X main.version=${VERSION} -X main.build= ${BUILD} " \
59
61
-o ${BIN_DIR} /${BIN} ./cmd/oci/
60
62
61
63
.PHONY : build-integration-tests
Original file line number Diff line number Diff line change @@ -23,8 +23,9 @@ import (
23
23
"github.com/oracle/oci-flexvolume-driver/pkg/oci/driver"
24
24
)
25
25
26
- // version is set at build time to the version of the driver being built.
26
+ // version/build is set at build time to the version of the driver being built.
27
27
var version string
28
+ var build string
28
29
29
30
// GetLogPath returns the default path to the driver log file.
30
31
func GetLogPath () string {
@@ -45,6 +46,6 @@ func main() {
45
46
defer f .Close ()
46
47
log .SetOutput (f )
47
48
48
- log .Printf ("OCI FlexVolume Driver version: %s" , version )
49
+ log .Printf ("OCI FlexVolume Driver version: %s (%s) " , version , build )
49
50
flexvolume .ExecDriver (& driver.OCIFlexvolumeDriver {}, os .Args )
50
51
}
You can’t perform that action at this time.
0 commit comments