Unverified Commit 5774a6e0 authored by Aleksana's avatar Aleksana Committed by GitHub
Browse files

prometheus-alertmanager: Add versionCheckHook (#461323)

parents f187c33a 9b1b9887
Loading
Loading
Loading
Loading
+13 −7
Original line number Diff line number Diff line
@@ -5,17 +5,17 @@
  fetchFromGitHub,
  installShellFiles,
  nixosTests,
  versionCheckHook,
}:

buildGoModule rec {
buildGoModule (finalAttrs: {
  pname = "alertmanager";
  version = "0.29.0";
  rev = "v${version}";

  src = fetchFromGitHub {
    inherit rev;
    owner = "prometheus";
    repo = "alertmanager";
    tag = "v${finalAttrs.version}";
    hash = "sha256-2uP4JCbQEe7/en5sBq/k73kqK6YVmuLvfiUy1fqPitw=";
  };

@@ -31,8 +31,8 @@ buildGoModule rec {
      t = "github.com/prometheus/common/version";
    in
    [
      "-X ${t}.Version=${version}"
      "-X ${t}.Revision=${src.rev}"
      "-X ${t}.Version=${finalAttrs.version}"
      "-X ${t}.Revision=unknown"
      "-X ${t}.Branch=unknown"
      "-X ${t}.BuildUser=nix@nixpkgs"
      "-X ${t}.BuildDate=unknown"
@@ -50,11 +50,17 @@ buildGoModule rec {

  passthru.tests = { inherit (nixosTests.prometheus) alertmanager; };

  nativeInstallCheckInputs = [
    versionCheckHook
  ];
  doInstallCheck = true;

  meta = with lib; {
    description = "Alert dispatcher for the Prometheus monitoring system";
    homepage = "https://github.com/prometheus/alertmanager";
    changelog = "https://github.com/prometheus/alertmanager/blob/v${version}/CHANGELOG.md";
    changelog = "https://github.com/prometheus/alertmanager/blob/v${finalAttrs.version}/CHANGELOG.md";
    license = licenses.asl20;
    mainProgram = "alertmanager";
    maintainers = with maintainers; [
      benley
      fpletz
@@ -62,4 +68,4 @@ buildGoModule rec {
      Frostman
    ];
  };
}
})
+0 −1
Original line number Diff line number Diff line
@@ -9530,7 +9530,6 @@ with pkgs;
  postgrest = haskellPackages.postgrest.bin;

  prom2json = callPackage ../servers/monitoring/prometheus/prom2json.nix { };
  prometheus-alertmanager = callPackage ../servers/monitoring/prometheus/alertmanager.nix { };
  prometheus-apcupsd-exporter = callPackage ../servers/monitoring/prometheus/apcupsd-exporter.nix { };
  prometheus-artifactory-exporter =
    callPackage ../servers/monitoring/prometheus/artifactory-exporter.nix