build: set build version in binary at build time

This commit is contained in:
mappu 2017-02-06 16:43:17 +13:00
parent 1d3f16e6c6
commit 761d0bfad5
2 changed files with 2 additions and 4 deletions

View File

@ -88,7 +88,7 @@ single_build() {
# GOARCH/GOOS supplied in function env
go build \
-a \
-ldflags '-s -w' \
-ldflags "-s -w -X main.VERSION=nmdc-webfrontend/${version}" \
-gcflags "-trimpath=${GOPATH}" \
-asmflags "-trimpath=${GOPATH}" \
-o "$(pathfix "${tmpdir}/${local_bin_name}")"

View File

@ -12,9 +12,7 @@ import (
"github.com/googollee/go-socket.io"
)
const (
VERSION = `nmdc-webfrontend/1.1.2`
)
var VERSION string = `nmdc-webfrontend/devel-unreleased`
type App struct {
cfg *Config