ping_exporter icon indicating copy to clipboard operation
ping_exporter copied to clipboard

Set version via -ldflags

Open dmke opened this issue 3 years ago • 0 comments

This automates tagging/building a bit and removes duplication.

Goreleaser, by default, adds versioning information to the go build and go release call:

$ goreleaser build --rm-dist --single-target --snapshot
   ...
   • getting and validating git state
      • releasing 0.4.7, commit d20774f4fa356511f93c7c5f0a8501117ddf1114
   ...

$ artifacts/ping_exporter_linux_amd64/ping_exporter --version
ping-exporter
Version: 0.4.7-SNAPSHOT-d20774f
Author(s): Philip Berndroth, Daniel Czerwonk
Metric exporter for go-icmp

dmke avatar Jul 06 '21 10:07 dmke