alertmanager-bot: pass version and revision variables

The bot outputs its own version/revision in the log during startup and
also in a response to the `/status` command.

So make sure both version and revision are set.
This commit is contained in:
Pavel Borzenkov 2021-04-21 15:56:48 +03:00
parent 1f1a77bdb7
commit ea1a726b9c

View file

@ -17,6 +17,12 @@ buildGoModule rec {
sed "s;/templates/default.tmpl;$out/share&;" -i cmd/alertmanager-bot/main.go
'';
preBuild = ''
export buildFlagsArray=(
"-ldflags=-s -w -X main.Version=v${version} -X main.Revision=${src.rev}"
)
'';
postInstall = ''
install -Dm644 -t $out/share/templates $src/default.tmpl
'';