Fix & tweak version & build-time info
This commit is contained in:
@@ -23,11 +23,9 @@ RELEASE_NAME = $(BUILD_NAME).tar.gz
|
||||
RELEASE_EXTRA_FILES ?= README.md LICENSE CONTRIBUTING.md DCO .env.example
|
||||
RELEASE_PKEY ?= .upload-rsa
|
||||
|
||||
|
||||
LDFLAGS_BUILD_TIME = -X github.com/cortezaproject/corteza-server/pkg/version.BuildTime=$(BUILD_TIME)
|
||||
LDFLAGS_VERSION = -X github.com/cortezaproject/corteza-server/pkg/version.Version=$(BUILD_VERSION)
|
||||
LDFLAGS_EXTRA ?=
|
||||
LDFLAGS = -ldflags "$(LDFLAGS_BUILD_TIME) $(LDFLAGS_GIT_TAG) $(LDFLAGS_EXTRA)"
|
||||
LDFLAGS = -ldflags "$(LDFLAGS_VERSION) $(LDFLAGS_EXTRA)"
|
||||
|
||||
|
||||
# Run watcher with a different event-trigger delay, eg:
|
||||
|
||||
@@ -2,13 +2,19 @@ package version
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/titpetric/factory/resputil"
|
||||
)
|
||||
|
||||
var (
|
||||
BuildTime = "undefined"
|
||||
Version = "undefined"
|
||||
// BuildTime value is set at build time and served over API and CLI
|
||||
BuildTime = time.Now().Format(time.RFC3339)
|
||||
|
||||
// Version is set as LDFLAG at build time:
|
||||
// -X github.com/cortezaproject/corteza-server/pkg/version.Version=....
|
||||
// See Makefile for details
|
||||
Version = "development"
|
||||
)
|
||||
|
||||
func HttpHandler(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
Reference in New Issue
Block a user