mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-10 23:11:01 +00:00
Log lattice version info
This commit is contained in:
parent
99869ce792
commit
6e917b6a9a
4 changed files with 13 additions and 2 deletions
3
Makefile
3
Makefile
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
CLONE_URL=github.com/pilosa/pilosa
|
||||
VERSION := $(shell git describe --tags 2> /dev/null || echo unknown)
|
||||
LATTICE_COMMIT := $(shell git -C lattice rev-parse --short HEAD || echo none)
|
||||
VARIANT = Molecula
|
||||
VERSION_ID = $(VERSION)-$(GOOS)-$(GOARCH)
|
||||
BRANCH := $(if $(TRAVIS_BRANCH),$(TRAVIS_BRANCH),$(if $(CIRCLE_BRANCH),$(CIRCLE_BRANCH),$(shell git rev-parse --abbrev-ref HEAD)))
|
||||
|
|
@ -9,7 +10,7 @@ BRANCH_ID := $(BRANCH)-$(GOOS)-$(GOARCH)
|
|||
BUILD_TIME := $(shell date -u +%FT%T%z)
|
||||
SHARD_WIDTH = 20
|
||||
COMMIT := $(shell git describe --exact-match >/dev/null 2>&1 || git rev-parse --short HEAD)
|
||||
LDFLAGS="-X github.com/pilosa/pilosa/v2.Version=$(VERSION) -X github.com/pilosa/pilosa/v2.BuildTime=$(BUILD_TIME) -X github.com/pilosa/pilosa/v2.Variant=$(VARIANT) -X github.com/pilosa/pilosa/v2.Commit=$(COMMIT)"
|
||||
LDFLAGS="-X github.com/pilosa/pilosa/v2.Version=$(VERSION) -X github.com/pilosa/pilosa/v2.BuildTime=$(BUILD_TIME) -X github.com/pilosa/pilosa/v2.Variant=$(VARIANT) -X github.com/pilosa/pilosa/v2.Commit=$(COMMIT) -X github.com/pilosa/pilosa/v2.LatticeCommit=$(LATTICE_COMMIT)"
|
||||
GO_VERSION=latest
|
||||
RELEASE ?= 0
|
||||
RELEASE_ENABLED = $(subst 0,,$(RELEASE))
|
||||
|
|
|
|||
5
api.go
5
api.go
|
|
@ -1626,6 +1626,11 @@ func (api *API) Version() string {
|
|||
return strings.TrimPrefix(Version, "v")
|
||||
}
|
||||
|
||||
// Version returns the Lattice version.
|
||||
func (api *API) LatticeVersion() string {
|
||||
return LatticeVersionInfo()
|
||||
}
|
||||
|
||||
// Info returns information about this server instance.
|
||||
func (api *API) Info() serverInfo {
|
||||
si := api.server.systemInfo
|
||||
|
|
|
|||
|
|
@ -455,7 +455,7 @@ type statikHandler struct {
|
|||
func NewStatikHandler(h *Handler) statikHandler {
|
||||
fs, err := h.FileSystem.New()
|
||||
if err == nil {
|
||||
h.logger.Printf("enabled Lattice UI at %s", h.api.Node().URI)
|
||||
h.logger.Printf("enabled Lattice UI (%s) at %s", h.api.LatticeVersion(), h.api.Node().URI)
|
||||
}
|
||||
|
||||
return statikHandler{
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ var Version string
|
|||
var Commit string
|
||||
var Variant string
|
||||
var BuildTime string
|
||||
var LatticeCommit string
|
||||
|
||||
func VersionInfo() string {
|
||||
var prefix string
|
||||
|
|
@ -50,3 +51,7 @@ func VersionInfo() string {
|
|||
|
||||
return prefix + "Pilosa" + suffix
|
||||
}
|
||||
|
||||
func LatticeVersionInfo() string {
|
||||
return "g" + LatticeCommit
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue