Get versioninfo from the git repository
Sets value of softwareVer during build
This commit is contained in:
parent
bdc4f270f8
commit
c25d0bef67
9
Makefile
9
Makefile
|
@ -1,7 +1,10 @@
|
|||
GITREV=`git describe --tags`
|
||||
LDFLAGS=-ldflags="-X 'github.com/writeas/writefreely.softwareVer=$(GITREV)'"
|
||||
|
||||
GOCMD=go
|
||||
GOINSTALL=$(GOCMD) install
|
||||
GOBUILD=$(GOCMD) build
|
||||
GOTEST=$(GOCMD) test
|
||||
GOINSTALL=$(GOCMD) install $(LDFLAGS)
|
||||
GOBUILD=$(GOCMD) build $(LDFLAGS)
|
||||
GOTEST=$(GOCMD) test $(LDFLAGS)
|
||||
GOGET=$(GOCMD) get
|
||||
BINARY_NAME=writefreely
|
||||
|
||||
|
|
8
app.go
8
app.go
|
@ -33,10 +33,12 @@ const (
|
|||
|
||||
serverSoftware = "WriteFreely"
|
||||
softwareURL = "https://writefreely.org"
|
||||
|
||||
softwareVer = "0.3"
|
||||
)
|
||||
|
||||
// Software version can be set from git env using -ldflags
|
||||
var softwareVer = "v0.3"
|
||||
|
||||
|
||||
var (
|
||||
debugging bool
|
||||
|
||||
|
@ -133,7 +135,7 @@ func pageForReq(app *app, r *http.Request) page.StaticPage {
|
|||
p := page.StaticPage{
|
||||
AppCfg: app.cfg.App,
|
||||
Path: r.URL.Path,
|
||||
Version: "v" + softwareVer,
|
||||
Version: softwareVer,
|
||||
}
|
||||
|
||||
// Add user information, if given
|
||||
|
|
Loading…
Reference in New Issue