From 3981cdc68052c5084c28ade768b635d24242aa6d Mon Sep 17 00:00:00 2001 From: Rasmus Dahlberg Date: Tue, 14 Sep 2021 10:22:02 +0200 Subject: added option to supply git-commit hash when compiling Usage: ``` $ go build -ldflags="-X 'main.gitCommit=$(git rev-list -1 HEAD)'" ``` --- cmd/sigsum_log_go/main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/sigsum_log_go/main.go b/cmd/sigsum_log_go/main.go index 6189b1d..786504d 100644 --- a/cmd/sigsum_log_go/main.go +++ b/cmd/sigsum_log_go/main.go @@ -37,11 +37,14 @@ var ( witnesses = flag.String("witnesses", "", "comma-separated list of trusted witness verification keys in hex") maxRange = flag.Int64("max_range", 10, "maximum number of entries that can be retrived in a single request") interval = flag.Duration("interval", time.Second*30, "interval used to rotate the log's cosigned STH") + + gitCommit = "unknown" ) func main() { flag.Parse() defer glog.Flush() + glog.Infof("sigsum-log-go git-commit %s", gitCommit) // wait for clean-up before exit var wg sync.WaitGroup -- cgit v1.2.3