From ee635d4645126d0821e75fe71b4e56ec7e119eaa Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 29 Nov 2021 18:53:54 +0300 Subject: [PATCH] chore(ops/modules): Configure besadii call sites to load config On whitby, the besadii config will live in /etc/secrets/besadii.json. This CL updates the call sites to pass this config path to besadii so that it can load Sourcegraph configuration. Change-Id: Ia139b9fa3b827e7a5f2386214390acc6fe19a75a --- ops/modules/monorepo-gerrit.nix | 10 ++++++++-- ops/modules/tvl-buildkite.nix | 7 ++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ops/modules/monorepo-gerrit.nix b/ops/modules/monorepo-gerrit.nix index 714aeeaa6..d9507db56 100644 --- a/ops/modules/monorepo-gerrit.nix +++ b/ops/modules/monorepo-gerrit.nix @@ -3,10 +3,16 @@ let cfg = config.services.gerrit; + + besadiiWithConfig = pkgs.writeShellScript "besadii-whitby" '' + export BESADII_CONFIG=/etc/secrets/besadii.json + exec ${depot.ops.besadii}/bin/besadii + ''; + gerritHooks = pkgs.runCommandNoCC "gerrit-hooks" {} '' mkdir -p $out - ln -s ${depot.ops.besadii}/bin/besadii $out/change-merged - ln -s ${depot.ops.besadii}/bin/besadii $out/patchset-created + ln -s ${besadiiWithConfig} $out/change-merged + ln -s ${besadiiWithConfig} $out/patchset-created ''; in { services.gerrit = { diff --git a/ops/modules/tvl-buildkite.nix b/ops/modules/tvl-buildkite.nix index 05a5e9b5e..de1497010 100644 --- a/ops/modules/tvl-buildkite.nix +++ b/ops/modules/tvl-buildkite.nix @@ -6,11 +6,16 @@ let agents = lib.range 1 cfg.agentCount; description = "Buildkite agents for TVL"; + besadiiWithConfig = pkgs.writeShellScript "besadii-whitby" '' + export BESADII_CONFIG=/etc/secrets/besadii.json + exec ${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 ${depot.ops.besadii}/bin/besadii $out/bin/post-command + ln -s ${besadiiWithConfig} $out/bin/post-command ''; in { options.services.depot.buildkite = {