3
0

Fix & tweak version & build-time info

This commit is contained in:
Denis Arh
2020-08-24 15:23:49 +02:00
parent 25a2f53145
commit 587a02562f
2 changed files with 9 additions and 5 deletions
+1 -3
View File
@@ -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:
+8 -2
View File
@@ -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) {