diff --git a/Makefile b/Makefile index a41fbf5..9d449d5 100644 --- a/Makefile +++ b/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 diff --git a/Version.go b/Version.go new file mode 100644 index 0000000..be90f61 --- /dev/null +++ b/Version.go @@ -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" +) diff --git a/main.go b/main.go index 570fd18..7bca483 100644 --- a/main.go +++ b/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