Add version and built info
Use current GIT commit ID and built info (time and machine) for versioning purpose
This commit is contained in:
Родитель
1096040f83
Коммит
63723f39b9
6
Makefile
6
Makefile
|
@ -3,10 +3,14 @@
|
|||
|
||||
export GOPATH=$(PWD)/_gopath
|
||||
|
||||
GITCOMMIT=`git rev-parse --short HEAD`
|
||||
BUILDTIME=`date +%FT%T%z`
|
||||
HOSTNAME=`hostname`
|
||||
|
||||
all: hdfs-mount
|
||||
|
||||
hdfs-mount: *.go $(GOPATH)/src/bazil.org/fuse $(GOPATH)/src/github.com/colinmarc/hdfs $(GOPATH)/src/golang.org/x/net/context $(GOPATH)/src/github.com/golang/protobuf/proto
|
||||
go build -o hdfs-mount
|
||||
go build -ldflags="-w -X main.GITCOMMIT=${GITCOMMIT} -X main.BUILDTIME=${BUILDTIME} -X main.HOSTNAME=${HOSTNAME}" -o hdfs-mount
|
||||
|
||||
$(GOPATH)/src/bazil.org/fuse: $(GOPATH)/src/github.com/bazil/fuse
|
||||
ln -s $(GOPATH)/src/github.com/bazil $(GOPATH)/src/bazil.org
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
package main
|
||||
|
||||
var (
|
||||
//TODO: Add Version tag, manually update
|
||||
// VERSION = "0.0.1"
|
||||
|
||||
// GITCommit overwritten automatically by the build
|
||||
GITCOMMIT = "HEAD"
|
||||
|
||||
// Built time overwritten automatically by the build
|
||||
BUILDTIME = "NOW"
|
||||
|
||||
// Built hostname overwritten automatically by build
|
||||
HOSTNAME = "LOCALHOST"
|
||||
)
|
2
main.go
2
main.go
|
@ -45,6 +45,8 @@ func main() {
|
|||
os.Exit(2)
|
||||
}
|
||||
|
||||
log.Print("hdfs-mount: current head GITCommit: ", GITCOMMIT, ", Built time: ", BUILDTIME, ", Built by:", HOSTNAME)
|
||||
|
||||
allowedPrefixes := strings.Split(*allowedPrefixesString, ",")
|
||||
|
||||
retryPolicy.MaxAttempts += 1 // converting # of retry attempts to total # of attempts
|
||||
|
|
Загрузка…
Ссылка в новой задаче