From 6d3a9e7b5feb13ae1595854254339686a2fc3c2d Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 29 Jun 2020 03:35:39 +0100 Subject: feat(besadii): Implement support for Buildkite's post-command hook This hook is invoked by Buildkite (on the runner) after every build stage. This change adds support in Besadii to run as this hook and update the build status on a Gerrit CL. Change-Id: Ie07a94d9b41645a77681cf42f6969d218abf93c1 Reviewed-on: https://cl.tvl.fyi/c/depot/+/761 Tested-by: BuildkiteCI Reviewed-by: Kane York --- users/tazjin/nixos/frog/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'users') diff --git a/users/tazjin/nixos/frog/default.nix b/users/tazjin/nixos/frog/default.nix index f3e75a2420..5d438e7b57 100644 --- a/users/tazjin/nixos/frog/default.nix +++ b/users/tazjin/nixos/frog/default.nix @@ -12,6 +12,13 @@ config: let frogEmacs = (depot.users.tazjin.emacs.overrideEmacs(epkgs: epkgs ++ [ depot.third_party.emacsPackages.google-c-style ])); + + # All Buildkite hooks are actually besadii, but it's being invoked + # with different names. + buildkiteHooks = depot.third_party.runCommandNoCC "buildkite-hooks" {} '' + mkdir -p $out/bin + ln -s ${depot.ops.besadii}/bin/besadii $out/bin/post-command + ''; in depot.lib.fix(self: { imports = [ "${depot.depotPath}/ops/nixos/v4l2loopback.nix" @@ -198,6 +205,7 @@ in depot.lib.fix(self: { services.buildkite-agents.frog = { enable = true; tokenPath = "/etc/secrets/buildkite-token"; + hooks.post-command = "${buildkiteHooks}/bin/post-command"; }; environment.systemPackages = -- cgit 1.4.1