2016-12-01 01:52:07 +01:00
|
|
|
{ stdenv, go, buildGoPackage, go-bindata, fetchFromGitHub }:
|
2016-06-05 16:11:11 +02:00
|
|
|
|
|
|
|
buildGoPackage rec {
|
|
|
|
name = "pushgateway-${version}";
|
2017-08-27 23:18:05 +02:00
|
|
|
version = "0.4.0";
|
2016-12-01 01:52:07 +01:00
|
|
|
rev = "v${version}";
|
2016-06-28 15:32:22 +02:00
|
|
|
|
2016-06-05 16:11:11 +02:00
|
|
|
goPackagePath = "github.com/prometheus/pushgateway";
|
|
|
|
|
2016-06-06 12:26:56 +02:00
|
|
|
src = fetchFromGitHub {
|
2016-06-05 16:11:11 +02:00
|
|
|
inherit rev;
|
2016-06-06 12:26:56 +02:00
|
|
|
owner = "prometheus";
|
|
|
|
repo = "pushgateway";
|
2017-08-27 23:18:05 +02:00
|
|
|
sha256 = "19hsv42addcx4dsjdbh64y7ggjvaaay9gag0342gz7gyl9sr719f";
|
2016-06-05 16:11:11 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ go-bindata ];
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
(
|
|
|
|
cd "go/src/$goPackagePath"
|
|
|
|
go-bindata ./resources/
|
|
|
|
)
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildFlagsArray = ''
|
|
|
|
-ldflags=
|
|
|
|
-X main.buildVersion=${version}
|
|
|
|
-X main.buildRev=${rev}
|
2016-12-01 01:52:07 +01:00
|
|
|
-X main.buildBranch=${rev}
|
2016-06-05 16:11:11 +02:00
|
|
|
-X main.buildUser=nix@nixpkgs
|
2016-12-01 01:52:07 +01:00
|
|
|
-X main.buildDate=19700101-00:00:00
|
2016-06-05 16:11:11 +02:00
|
|
|
-X main.goVersion=${stdenv.lib.getVersion go}
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Allows ephemeral and batch jobs to expose metrics to Prometheus";
|
|
|
|
homepage = https://github.com/prometheus/pushgateway;
|
|
|
|
license = licenses.asl20;
|
2016-12-01 01:52:07 +01:00
|
|
|
maintainers = with maintainers; [ benley fpletz ];
|
2016-06-05 16:11:11 +02:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|