From 280fb298f900dcd6fbacc02e6741ff76684012c9 Mon Sep 17 00:00:00 2001 From: sterni Date: Sat, 18 Jan 2025 22:12:22 +0100 Subject: [PATCH] fix(nix/buildkite): pass extraSteps script to buildkite directly Fixes execution of extraSteps on a machine that hasn't built the pipeline and thus realised the extra step shell script. You can sort of dump a script into `command` for buildkite as long as you escape any variable access since buildkit would substitute those before entering the step environment. Change-Id: I8ddc0b80f6f568204ea6c80a118533bc11786473 Reviewed-on: https://cl.tvl.fyi/c/depot/+/12992 Reviewed-by: tazjin Autosubmit: sterni Tested-by: BuildkiteCI --- nix/buildkite/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nix/buildkite/default.nix b/nix/buildkite/default.nix index d229e9885..3b6e4475f 100644 --- a/nix/buildkite/default.nix +++ b/nix/buildkite/default.nix @@ -457,7 +457,7 @@ rec { (buildEnabled && !cfg.alwaysRun && !cfg.needsOutput) cfg.parent.key; - command = pkgs.writeShellScript "${cfg.key}-script" '' + command = '' set -ueo pipefail ${lib.optionalString cfg.needsOutput "echo '~~~ Preparing build output of ${cfg.parentLabel}'" @@ -478,7 +478,8 @@ rec { } })" echo '+++ Running extra step script' - exec "$command_script" + # ATTN: buildkite substitutes this variable outside of the execution for some reason + exec "\$command_script" ''; soft_fail = cfg.softFail;