Global agent selector for pipelines

It would be really nice to be able to specify agent rules on the pipeline level, not only on the step level.

I would like a “staging” pipeline that runs the exact same steps as the main pipeline, except it adds “queue=staging” to the agent selector rules of all steps.
I am currently faking it by having something like this in every step, and then setting BUILDKITE_QUEUE as a pipeline env variable.

  agents:                                                                                                                                                                                              
      - "size=medium"                                                                                                                                                                                    
      - "queue=${BUILDKITE_QUEUE:-default}"

@haraldschioberg :wave: Hey! Thanks for reaching out :slight_smile:

We support this at the moment (although it’s a little hidden - we could do a way better job of documenting this).

If you convert your pipeline to use “YAML Steps” - you’ll be able to start using agents as a top level key in your pipeline.yml file:

Here’s some more information: 🚀 Setting Default Agents for a Build

We’ve not been able to make it generally available at the moment due to some backwards incompatibility with old pipeline files, but it’s something we’re hoping to figure out! :crossed_fingers:

1 Like