2021-01-25 00:26:54 -08:00
|
|
|
{ lib, go, buildGoPackage, fetchFromGitHub }:
|
2016-06-05 07:11:11 -07:00
|
|
|
|
|
|
|
buildGoPackage rec {
|
2019-08-15 05:41:18 -07:00
|
|
|
pname = "pushgateway";
|
2021-02-05 07:05:35 -08:00
|
|
|
version = "1.4.0";
|
2016-11-30 16:52:07 -08:00
|
|
|
rev = "v${version}";
|
2016-06-28 06:32:22 -07:00
|
|
|
|
2016-06-05 07:11:11 -07:00
|
|
|
goPackagePath = "github.com/prometheus/pushgateway";
|
|
|
|
|
2016-06-06 03:26:56 -07:00
|
|
|
src = fetchFromGitHub {
|
2016-06-05 07:11:11 -07:00
|
|
|
inherit rev;
|
2016-06-06 03:26:56 -07:00
|
|
|
owner = "prometheus";
|
|
|
|
repo = "pushgateway";
|
2021-02-05 07:05:35 -08:00
|
|
|
sha256 = "sha256-230JgG+TtAuopkkcUda+0hl8E6WXOtTUygWoyorLiEU=";
|
2016-06-05 07:11:11 -07:00
|
|
|
};
|
|
|
|
|
2019-02-17 19:08:00 -08:00
|
|
|
buildUser = "nix@nixpkgs";
|
|
|
|
buildDate = "19700101-00:00:00";
|
2016-06-05 07:11:11 -07:00
|
|
|
|
|
|
|
buildFlagsArray = ''
|
|
|
|
-ldflags=
|
2019-02-17 19:08:00 -08:00
|
|
|
-X github.com/prometheus/pushgateway/vendor/github.com/prometheus/common/version.Version=${version}
|
|
|
|
-X github.com/prometheus/pushgateway/vendor/github.com/prometheus/common/version.Revision=${rev}
|
|
|
|
-X github.com/prometheus/pushgateway/vendor/github.com/prometheus/common/version.Branch=${rev}
|
|
|
|
-X github.com/prometheus/pushgateway/vendor/github.com/prometheus/common/version.BuildUser=${buildUser}
|
|
|
|
-X github.com/prometheus/pushgateway/vendor/github.com/prometheus/common/version.BuildDate=${buildDate}
|
2021-01-14 23:07:56 -08:00
|
|
|
-X main.goVersion=${lib.getVersion go}
|
2016-06-05 07:11:11 -07:00
|
|
|
'';
|
|
|
|
|
2019-02-17 19:08:00 -08:00
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
2020-04-27 18:50:57 -07:00
|
|
|
export PATH=$PATH:$out/bin
|
2019-02-17 19:08:00 -08:00
|
|
|
|
|
|
|
pushgateway --help
|
|
|
|
|
|
|
|
# Make sure our -X options were included in the build
|
|
|
|
for s in ${version} ${rev} ${buildUser} ${buildDate}; do
|
|
|
|
pushgateway --version 2>&1 | fgrep -q -- "$s" || { echo "pushgateway --version output missing $s"; exit 1; }
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2021-01-10 23:54:33 -08:00
|
|
|
meta = with lib; {
|
2016-06-05 07:11:11 -07:00
|
|
|
description = "Allows ephemeral and batch jobs to expose metrics to Prometheus";
|
2020-03-31 18:11:51 -07:00
|
|
|
homepage = "https://github.com/prometheus/pushgateway";
|
2016-06-05 07:11:11 -07:00
|
|
|
license = licenses.asl20;
|
2019-08-01 23:07:42 -07:00
|
|
|
maintainers = with maintainers; [ benley fpletz ];
|
2016-06-05 07:11:11 -07:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|