feat(nix/buildkite): Support un-gated post-build extra steps

Allows users to define steps with `postBuild = true` which always run
after 🦆, 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 <sternenseemann@systemli.org>
Autosubmit: tazjin <tazjin@tvl.su>
This commit is contained in:
Vincent Ambo 2022-01-22 16:11:58 +03:00 committed by clbot
parent 4d7dcf10ed
commit 9e28029705

View file

@ -159,7 +159,7 @@ in rec {
splitExtraSteps = partition ({ postStep, ... }: postStep) splitExtraSteps = partition ({ postStep, ... }: postStep)
(attrValues (mapAttrs (name: value: { (attrValues (mapAttrs (name: value: {
inherit name value; inherit name value;
postStep = value ? prompt; postStep = (value ? prompt) || (value.postBuild or false);
}) (target.meta.ci.extraSteps or {}))); }) (target.meta.ci.extraSteps or {})));
mkExtraStep' = { name, value, ... }: mkExtraStep step name value; mkExtraStep' = { name, value, ... }: mkExtraStep step name value;
@ -238,6 +238,10 @@ in rec {
# confirmation. These steps always run after the main build is # confirmation. These steps always run after the main build is
# done and have no influence on CI status. # 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 # needsOutput (optional): If set to true, the parent derivation
# will be built in the working directory before running the # will be built in the working directory before running the
# command. Output will be available as 'result'. # command. Output will be available as 'result'.
@ -280,7 +284,8 @@ in rec {
prompt ? false, prompt ? false,
needsOutput ? false, needsOutput ? false,
branches ? null, branches ? null,
alwaysRun ? false alwaysRun ? false,
postBuild ? false
}@cfg: let }@cfg: let
parentLabel = parent.env.READTREE_TARGET; parentLabel = parent.env.READTREE_TARGET;