From 6faf0edaff463fd1195e2d5642252a34ea17481a Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 6 Dec 2021 19:19:05 +0300 Subject: fix(ops): Correctly pass command name to besadii invocations Ensure that besadii sees $0 as the correct command name, since that is the sole mechanism by which its functionality is switched around. There was a lingering commit that introduced this bug and hadn't been deployed in a couple of days. Maybe time to tighten deploy cycles soon ... Change-Id: Ie4284c0f6e5e06d71a71a3702ec7e092260e0ce5 --- ops/modules/monorepo-gerrit.nix | 8 ++++---- ops/modules/tvl-buildkite.nix | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ops/modules/monorepo-gerrit.nix b/ops/modules/monorepo-gerrit.nix index d9507db56e..57f2edc846 100644 --- a/ops/modules/monorepo-gerrit.nix +++ b/ops/modules/monorepo-gerrit.nix @@ -4,15 +4,15 @@ let cfg = config.services.gerrit; - besadiiWithConfig = pkgs.writeShellScript "besadii-whitby" '' + besadiiWithConfig = name: pkgs.writeShellScript "besadii-whitby" '' export BESADII_CONFIG=/etc/secrets/besadii.json - exec ${depot.ops.besadii}/bin/besadii + exec -a ${name} ${depot.ops.besadii}/bin/besadii "$@" ''; gerritHooks = pkgs.runCommandNoCC "gerrit-hooks" {} '' mkdir -p $out - ln -s ${besadiiWithConfig} $out/change-merged - ln -s ${besadiiWithConfig} $out/patchset-created + ln -s ${besadiiWithConfig "change-merged"} $out/change-merged + ln -s ${besadiiWithConfig "patchset-created"} $out/patchset-created ''; in { services.gerrit = { diff --git a/ops/modules/tvl-buildkite.nix b/ops/modules/tvl-buildkite.nix index de14970100..a0236a5e79 100644 --- a/ops/modules/tvl-buildkite.nix +++ b/ops/modules/tvl-buildkite.nix @@ -6,16 +6,16 @@ let agents = lib.range 1 cfg.agentCount; description = "Buildkite agents for TVL"; - besadiiWithConfig = pkgs.writeShellScript "besadii-whitby" '' + besadiiWithConfig = name: pkgs.writeShellScript "besadii-whitby" '' export BESADII_CONFIG=/etc/secrets/besadii.json - exec ${depot.ops.besadii}/bin/besadii + exec -a ${name} ${depot.ops.besadii}/bin/besadii "$@" ''; # All Buildkite hooks are actually besadii, but it's being invoked # with different names. buildkiteHooks = pkgs.runCommandNoCC "buildkite-hooks" {} '' mkdir -p $out/bin - ln -s ${besadiiWithConfig} $out/bin/post-command + ln -s ${besadiiWithConfig "post-command"} $out/bin/post-command ''; in { options.services.depot.buildkite = { -- cgit 1.4.1