Add version and build number output
This commit is contained in:
parent
471daf12ea
commit
bcfbad42b6
3 changed files with 16 additions and 1 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -3,6 +3,6 @@
|
|||
*.pem
|
||||
.*.swp
|
||||
.idea/
|
||||
cacert-board_vote
|
||||
cacert-boardvoting
|
||||
config.yaml
|
||||
database.sqlite
|
||||
|
|
11
Makefile
Normal file
11
Makefile
Normal file
|
@ -0,0 +1,11 @@
|
|||
VERSION := $(shell git describe --always --dirty=-dev)
|
||||
BUILD := $(shell date --iso-8601=seconds --utc)
|
||||
GOFILES := $(wildcard *.go)
|
||||
|
||||
cacert-boardvoting: ${GOFILES}
|
||||
go build -o $@ -ldflags "-X 'main.version=${VERSION}' -X 'main.build=${BUILD}'"
|
||||
|
||||
clean:
|
||||
rm -f cacert-boardvoting
|
||||
|
||||
.PHONY: clean
|
|
@ -23,6 +23,8 @@ import (
|
|||
var logger *log.Logger
|
||||
var config *Config
|
||||
var store *sessions.CookieStore
|
||||
var version = "undefined"
|
||||
var build = "undefined"
|
||||
|
||||
const sessionCookieName = "votesession"
|
||||
|
||||
|
@ -407,6 +409,8 @@ func init() {
|
|||
}
|
||||
|
||||
func main() {
|
||||
logger.Printf("CAcert Board Voting version %s, build %s\n", version, build)
|
||||
|
||||
var err error
|
||||
db, err = sqlx.Open("sqlite3", config.DatabaseFile)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in a new issue