summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Dittberner <jan@dittberner.info>2017-04-18 16:07:54 +0200
committerJan Dittberner <jan@dittberner.info>2017-04-22 00:12:32 +0200
commitbcfbad42b66aa29f85b283dc9aed362d3ff97f84 (patch)
tree27703598910f17782229c3620ee638dadff0d18a
parent471daf12ea98aa2a7fcb11deff9697403c5dd6a5 (diff)
downloadcacert-boardvoting-bcfbad42b66aa29f85b283dc9aed362d3ff97f84.tar.gz
cacert-boardvoting-bcfbad42b66aa29f85b283dc9aed362d3ff97f84.tar.xz
cacert-boardvoting-bcfbad42b66aa29f85b283dc9aed362d3ff97f84.zip
Add version and build number output
-rw-r--r--.gitignore2
-rw-r--r--Makefile11
-rw-r--r--boardvoting.go4
3 files changed, 16 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index 146c03e..79c64c5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,6 +3,6 @@
*.pem
.*.swp
.idea/
-cacert-board_vote
+cacert-boardvoting
config.yaml
database.sqlite
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..857255e
--- /dev/null
+++ b/Makefile
@@ -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
diff --git a/boardvoting.go b/boardvoting.go
index c467b40..8ad5438 100644
--- a/boardvoting.go
+++ b/boardvoting.go
@@ -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 {