mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-07 09:05:55 +00:00
Merge pull request #387 from jaffee/384-time-version-bug
give appropriate path in ldflags for BuildTime and Version
This commit is contained in:
commit
e8ab4cfc2d
3 changed files with 3 additions and 16 deletions
2
Makefile
2
Makefile
|
|
@ -6,7 +6,7 @@ VERSION := $(shell git describe --tags)
|
|||
IDENTIFIER := $(VERSION)-$(GOOS)-$(GOARCH)
|
||||
CLONE_URL=github.com/pilosa/pilosa
|
||||
BUILD_TIME=`date -u +%FT%T%z`
|
||||
LDFLAGS=-ldflags "-X main.Version=$(VERSION) -X main.BuildTime=$(BUILD_TIME)"
|
||||
LDFLAGS=-ldflags "-X github.com/pilosa/pilosa/cmd.Version=$(VERSION) -X github.com/pilosa/pilosa/cmd.BuildTime=$(BUILD_TIME)"
|
||||
|
||||
default: test pilosa
|
||||
|
||||
|
|
|
|||
|
|
@ -25,8 +25,8 @@ It will load existing data from the configured
|
|||
directory, and start listening client connections
|
||||
on the configured port.`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
serve.Server.Handler.Version = server.Version
|
||||
fmt.Fprintf(serve.Stderr, "Pilosa %s, build time %s\n", server.Version, server.BuildTime)
|
||||
serve.Server.Handler.Version = Version
|
||||
fmt.Fprintf(serve.Stderr, "Pilosa %s, build time %s\n", Version, BuildTime)
|
||||
|
||||
// Parse command line arguments.
|
||||
if err := serve.SetupConfig(args); err != nil {
|
||||
|
|
|
|||
|
|
@ -14,20 +14,7 @@ import (
|
|||
"github.com/pilosa/pilosa"
|
||||
)
|
||||
|
||||
// Version and BuildTime hold the version/build time information passed in at compile time.
|
||||
var (
|
||||
Version string
|
||||
BuildTime string
|
||||
)
|
||||
|
||||
func init() {
|
||||
if Version == "" {
|
||||
Version = "v0.0.0"
|
||||
}
|
||||
if BuildTime == "" {
|
||||
BuildTime = "not recorded"
|
||||
}
|
||||
|
||||
rand.Seed(time.Now().UTC().UnixNano())
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue