This repository was archived by the owner on Feb 8, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 1111LIBVIRT_BUILD_TAG =
1212endif
1313
14+ COMMIT =` git describe --dirty --always --tags 2> /dev/null || true `
15+ GOLDFLAGS ="-X main.gitCommit=${COMMIT} -X main.version=${VERSION}"
1416HYPER_BULD_TAGS =$(XEN_BUILD_TAG ) $(LIBVIRT_BUILD_TAG )
17+
1518all-local : build-runv
1619clean-local :
1720 -rm -f runv
1821install-exec-local :
1922 $(INSTALL_PROGRAM ) runv $(bindir )
2023
2124build-runv :
22- go build -tags " static_build $( HYPER_BULD_TAGS) " -o runv .
25+ go build -tags " static_build $( HYPER_BULD_TAGS) " -ldflags ${GOLDFLAGS} - o runv .
2326test-integration :
2427 cd integration-test/test_data && make
2528 cd integration-test && go test -check.v -test.timeout=120m ${TESTFLAGS} .
Original file line number Diff line number Diff line change @@ -20,8 +20,12 @@ import (
2020 "google.golang.org/grpc/grpclog"
2121)
2222
23+ var (
24+ version = ""
25+ gitCommit = ""
26+ )
27+
2328const (
24- version = "0.8.1"
2529 specConfig = "config.json"
2630 stateJson = "state.json"
2731 usage = `Open Container Initiative hypervisor-based runtime
@@ -59,7 +63,7 @@ func main() {
5963 app := cli .NewApp ()
6064 app .Name = "runv"
6165 app .Usage = usage
62- app .Version = version
66+ app .Version = fmt . Sprintf ( "%s, commit: %s" , version , gitCommit )
6367 app .Flags = []cli.Flag {
6468 cli.BoolFlag {
6569 Name : "debug" ,
You can’t perform that action at this time.
0 commit comments