feat(ops/buildkite): Allow agents targeting

Using the `agents` attribute, it lets the user target specific agents to run a step.

Change-Id: Id6fc0981d4879b77598854e1f296dffffb33a405
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5974
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
This commit is contained in:
Jean-François Roche 2022-07-23 00:47:21 +02:00
parent b9d79109dd
commit 45c794f1b3

View file

@ -324,6 +324,7 @@ rec {
# TODO(tazjin): Turn into hard-failure after 2022-10-01. # TODO(tazjin): Turn into hard-failure after 2022-10-01.
, postBuild ? null , postBuild ? null
, skip ? false , skip ? false
, agents ? null
}: }:
let let
parent = overridableParent parentOverride; parent = overridableParent parentOverride;
@ -348,7 +349,8 @@ rec {
needsOutput needsOutput
parent parent
parentLabel parentLabel
skip; skip
agents;
# //nix/buildkite is growing a new feature for adding different # //nix/buildkite is growing a new feature for adding different
# "build phases" which supersedes the previous `postBuild` # "build phases" which supersedes the previous `postBuild`
@ -407,7 +409,7 @@ rec {
echo '+++ Running extra step command' echo '+++ Running extra step command'
exec ${cfg.command} exec ${cfg.command}
''; '';
}; } // (lib.optionalAttrs (cfg.agents != null) { inherit (cfg) agents; });
in in
if (isString cfg.prompt) if (isString cfg.prompt)
then then