Builds of redis_exporter do not set version, sha1, build date
Summary
We aren't setting versions when building redis_exporter
Steps to reproduce
Install and reconfigure, then check the logs of the redis-exporter.
$ gitlab-ctl tail redis-exporter
2018-03-23_11:33:14.97994 time="2018-03-23T11:33:14Z" level=info msg="Redis Metrics Exporter <<< filled in by build >>> build date: <<< filled in by build >>> sha1: <<< filled in by build >>> Go: go1.9.2
What is the current bug behavior?
Lots of <<< filled in by build >>>
which aren't filled in.
What is the expected correct behavior?
Some sane values instead of <<< filled in by build >>>
We can supply them using -ldflags to the go build invocation.
$ go build -ldflags="-X main.VERSION=\"$(git describe --tags HEAD)\" -X main.BUILD_DATE=\"$(date +%s)\" -X main.COMMIT_SHA1=\"$(git rev-parse HEAD)\"" .
$ ./redis_exporter
INFO[0000] Redis Metrics Exporter "v0.17.1" build date: "1521806836" sha1: "e0df01633ff5493fce3132af8ceee1a0d996395d" Go: go1.10