2021-02-05 17:12:51 +00:00
|
|
|
{ lib, go, buildGoPackage, fetchFromGitHub }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildGoPackage rec {
|
|
|
|
pname = "pushgateway";
|
2021-02-13 14:23:35 +00:00
|
|
|
version = "1.4.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
|
|
|
|
goPackagePath = "github.com/prometheus/pushgateway";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
inherit rev;
|
|
|
|
owner = "prometheus";
|
|
|
|
repo = "pushgateway";
|
2021-02-13 14:23:35 +00:00
|
|
|
sha256 = "sha256-230JgG+TtAuopkkcUda+0hl8E6WXOtTUygWoyorLiEU=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildUser = "nix@nixpkgs";
|
|
|
|
buildDate = "19700101-00:00:00";
|
|
|
|
|
2021-08-27 14:25:00 +00:00
|
|
|
ldflags = [
|
|
|
|
"-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}"
|
|
|
|
"-X main.goVersion=${lib.getVersion go}"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
2020-05-15 21:57:56 +00:00
|
|
|
export PATH=$PATH:$out/bin
|
2020-04-24 23:36:52 +00: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-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Allows ephemeral and batch jobs to expose metrics to Prometheus";
|
|
|
|
homepage = "https://github.com/prometheus/pushgateway";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ benley fpletz ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|