2019-02-18 03:08:00 +00:00
|
|
|
{ stdenv, go, buildGoPackage, fetchFromGitHub }:
|
2016-06-05 15:11:11 +01:00
|
|
|
|
|
|
|
buildGoPackage rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "pushgateway";
|
2019-04-15 15:12:14 +01:00
|
|
|
version = "0.8.0";
|
2016-12-01 00:52:07 +00:00
|
|
|
rev = "v${version}";
|
2016-06-28 14:32:22 +01:00
|
|
|
|
2016-06-05 15:11:11 +01:00
|
|
|
goPackagePath = "github.com/prometheus/pushgateway";
|
|
|
|
|
2016-06-06 11:26:56 +01:00
|
|
|
src = fetchFromGitHub {
|
2016-06-05 15:11:11 +01:00
|
|
|
inherit rev;
|
2016-06-06 11:26:56 +01:00
|
|
|
owner = "prometheus";
|
|
|
|
repo = "pushgateway";
|
2019-04-15 15:12:14 +01:00
|
|
|
sha256 = "1mzwkxnznv6wzy7dc8rksa8gr7z92plrzls8gb8rk432zfqcbv6a";
|
2016-06-05 15:11:11 +01:00
|
|
|
};
|
|
|
|
|
2019-02-18 03:08:00 +00:00
|
|
|
buildUser = "nix@nixpkgs";
|
|
|
|
buildDate = "19700101-00:00:00";
|
2016-06-05 15:11:11 +01:00
|
|
|
|
|
|
|
buildFlagsArray = ''
|
|
|
|
-ldflags=
|
2019-02-18 03:08:00 +00: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}
|
2016-06-05 15:11:11 +01:00
|
|
|
-X main.goVersion=${stdenv.lib.getVersion go}
|
|
|
|
'';
|
|
|
|
|
2019-02-18 03:08:00 +00:00
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
|
|
|
export PATH=$PATH:$bin/bin
|
|
|
|
|
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2016-06-05 15:11:11 +01:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Allows ephemeral and batch jobs to expose metrics to Prometheus";
|
|
|
|
homepage = https://github.com/prometheus/pushgateway;
|
|
|
|
license = licenses.asl20;
|
2019-08-02 07:07:42 +01:00
|
|
|
maintainers = with maintainers; [ benley fpletz ];
|
2016-06-05 15:11:11 +01:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|