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.
commitea1a726b9c1ca621b9a7c378f5a8cc8fe08aceab
authorPavel Borzenkov <pavel@borzenkov.net>
dateWed 21 Apr 2021, 15:56 (6 years ago)
parent1f1a77b
pkgs/servers/monitoring/alertmanager-bot/default.nix+6
@@ -17,6 +17,12 @@ buildGoModule rec {
1717 sed "s;/templates/default.tmpl;$out/share&;" -i cmd/alertmanager-bot/main.go
1818 '';
1919
20+ preBuild = ''
21+ export buildFlagsArray=(
22+ "-ldflags=-s -w -X main.Version=v${version} -X main.Revision=${src.rev}"
23+ )
24+ '';
25+
2026 postInstall = ''
2127 install -Dm644 -t $out/share/templates $src/default.tmpl
2228 '';