add git version at build time
This commit is contained in:
parent
cf851b5021
commit
a1c3b66705
4
Makefile
Normal file
4
Makefile
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
GIT_COMMIT := $(shell git rev-list -1 HEAD)
|
||||||
|
|
||||||
|
all:
|
||||||
|
go build -ldflags "-X main.GitCommit=$(GIT_COMMIT)"
|
4
main.go
4
main.go
@ -15,9 +15,11 @@ var cookieHandler = securecookie.New(
|
|||||||
securecookie.GenerateRandomKey(64),
|
securecookie.GenerateRandomKey(64),
|
||||||
securecookie.GenerateRandomKey(32))
|
securecookie.GenerateRandomKey(32))
|
||||||
var passwordTokenSet map[string]bool
|
var passwordTokenSet map[string]bool
|
||||||
|
var GitCommit string
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
Conf, _ = LoadConfig()
|
Conf, _ = LoadConfig()
|
||||||
|
version := GitCommit
|
||||||
log.Println("Loaded config")
|
log.Println("Loaded config")
|
||||||
router := mux.NewRouter().StrictSlash(true)
|
router := mux.NewRouter().StrictSlash(true)
|
||||||
router.HandleFunc("/", homePage).Methods("GET")
|
router.HandleFunc("/", homePage).Methods("GET")
|
||||||
@ -56,7 +58,7 @@ func main() {
|
|||||||
log.Printf("Max employeeNumber set to %v\n", Conf.MaxID)
|
log.Printf("Max employeeNumber set to %v\n", Conf.MaxID)
|
||||||
}
|
}
|
||||||
passwordTokenSet = make(map[string]bool)
|
passwordTokenSet = make(map[string]bool)
|
||||||
log.Printf("Guildgate starting on %v\n", Conf.Port)
|
log.Printf("Guildgate v%v starting on %v\n", version, Conf.Port)
|
||||||
if Conf.Tls {
|
if Conf.Tls {
|
||||||
log.Printf("Starting TLS\n")
|
log.Printf("Starting TLS\n")
|
||||||
if Conf.Cert == "" {
|
if Conf.Cert == "" {
|
||||||
|
Loading…
Reference in New Issue
Block a user