From 9e28029705eedbf160274476fcdf7b6fc45b3db8 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 22 Jan 2022 16:11:58 +0300 Subject: [PATCH] feat(nix/buildkite): Support un-gated post-build extra steps Allows users to define steps with `postBuild = true` which always run after :duck:, but do not require human approvals. This can be useful for things like unconditional release steps. Change-Id: Idbf6c48a9dedcfc6cc9b7f098423364e2fa72d2d Reviewed-on: https://cl.tvl.fyi/c/depot/+/5052 Tested-by: BuildkiteCI Reviewed-by: sterni Autosubmit: tazjin --- nix/buildkite/default.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/nix/buildkite/default.nix b/nix/buildkite/default.nix index 6bf7feb8b..f8d69b239 100644 --- a/nix/buildkite/default.nix +++ b/nix/buildkite/default.nix @@ -159,7 +159,7 @@ in rec { splitExtraSteps = partition ({ postStep, ... }: postStep) (attrValues (mapAttrs (name: value: { inherit name value; - postStep = value ? prompt; + postStep = (value ? prompt) || (value.postBuild or false); }) (target.meta.ci.extraSteps or {}))); mkExtraStep' = { name, value, ... }: mkExtraStep step name value; @@ -238,6 +238,10 @@ in rec { # confirmation. These steps always run after the main build is # done and have no influence on CI status. # + # postBuild (optional): If set to true, this step will run after + # all primary build steps (that is, after status has been reported + # back to CI). + # # needsOutput (optional): If set to true, the parent derivation # will be built in the working directory before running the # command. Output will be available as 'result'. @@ -280,7 +284,8 @@ in rec { prompt ? false, needsOutput ? false, branches ? null, - alwaysRun ? false + alwaysRun ? false, + postBuild ? false }@cfg: let parentLabel = parent.env.READTREE_TARGET;