Unverified Commit 632ebb90 authored by Emily's avatar Emily Committed by GitHub
Browse files

Merge pull request #292122 from emilylange/grafana-agent

grafana-agent: add passthru.updateScript, 0.39.2 -> 0.40.2
parents f46d58c5 3ab086e2
Loading
Loading
Loading
Loading
+17 −11
Original line number Diff line number Diff line
@@ -2,10 +2,11 @@
, buildGoModule
, fetchFromGitHub
, fetchYarnDeps
, prefetch-yarn-deps
, grafana-agent
, nix-update-script
, nixosTests
, nodejs
, prefetch-yarn-deps
, stdenv
, systemd
, testers
@@ -14,21 +15,21 @@

buildGoModule rec {
  pname = "grafana-agent";
  version = "0.39.2";
  version = "0.40.2";

  src = fetchFromGitHub {
    owner = "grafana";
    repo = "agent";
    rev = "v${version}";
    hash = "sha256-KwXkCTKnoXHL2RFpJjjwtIolEpqCM6te5wMk9xQNOqE=";
    hash = "sha256-muSgFBg+/XWx2f9EGYYLQ0wUzZ7AxEC2F19A5Qs5cgw=";
  };

  vendorHash = "sha256-aSHO5SoMem14Fc6DirqtYBVWJQtf5mzCT3T33mMyhkc=";
  vendorHash = "sha256-ekFl+aSmyUvgv4pkpS86HwPMfqtDaJEaZhWiwHjHp9g=";
  proxyVendor = true; # darwin/linux hash mismatch

  frontendYarnOfflineCache = fetchYarnDeps {
    yarnLock = src + "/web/ui/yarn.lock";
    hash = "sha256-rT0UCInISo/p60xzQC7wAJFuKFByIzhNf0RxFFJx+3k=";
    hash = "sha256-WqbIg18qUNcs9O2wh7DAzwXKb60iEuPL8zFCIgScqI0=";
  };

  ldflags = let
@@ -89,7 +90,8 @@ buildGoModule rec {
      $out/bin/grafana-agent
  '';

  passthru.tests = {
  passthru = {
    tests = {
      inherit (nixosTests) grafana-agent;
      version = testers.testVersion {
        inherit version;
@@ -97,6 +99,10 @@ buildGoModule rec {
        package = grafana-agent;
      };
    };
    updateScript = nix-update-script { };
    # alias for nix-update to be able to find and update this attribute
    offlineCache = frontendYarnOfflineCache;
  };

  meta = {
    description = "A lightweight subset of Prometheus and more, optimized for Grafana Cloud";