Wildcards in the agent tag configuration

Hey there :wave:,

We have been using the YAML file tags to match specific machine images that need to be selected to run the build, for example (xcode: 13.0.0)—based on that, we obtain the value and run the job in a VM with the specified version of Xcode.

For the above workflow to work successfully, we need to set the tag in the configuration file in the machine where the agent is running! I noticed that it’s possible to use wildcards from the YAML, as explained in buildkite-agent start v3 | Buildkite Documentation.

For example, can we use wildcards for tags specified in the agent configuration (tags="os=macos,xcode=*")? In that way, the YAML step can continue setting the tag xcode: 13.0.0, and the agent will use that wildcard queue for it?

Thanks for your help!

Hi @Vkt0r Welcome to Buildkite community and we are happy to help you with the question.

In Agent configuration, we should always have key/value as tag for example “xcode=13.0.0”. It cannot be wildcard in the agent tag configuration.

Now in the pipeline yaml as explained in the documentation of agent targeting we can use wildcard as shown below:

steps:

  • command: “script.sh”
    agents:
    xcode: ‘*’

This way step in this pipeline.yml can be dispatched to only agents which have tag that has key as “xcode” and any value.

So we cannot use wildcards in agent configuration of tags and it will be the other way as explained above. I hope this answers the question.

Once again welcome to the Buildkite community.

1 Like

Thanks @suma!