Building Dynamic CI Pipeline with BuildKite


I was inspired by this BuildKite pipeline sample given by the support team:

YAML

So in the above case, if the first 2 commands succeed, pipeline.deploy.yml will be loaded into the main CI pipeline. This implementation is just brilliant. I’m not sure if jenkinsfile can do dynamic pipeline like this, but at least jenkinsfile won’t look as elegant as yaml.

Since buildkite-agent pipeline upload .buildkite/pipeline.deploy.yml is just another bash command, I can even use it in a script to put more logic in it, such as git flow implementation like:

YAML

FYI. example tested with BuildKite agent version 3.2.0.

🙂