Adding multiple pipeline.yml files to a repo

We have a ruby project.

We want to first test then build the docker image and push that to AWS ECR and then deploy that to an env.

If I add separate pipeline files for test, build and deploy to AWS ECS should they be name liked as follows and work?

  1. pipeline.yml. - assuming buildkite automatically uses that to run all specs
  2. pipeline.build.yml - if the build pipeline was kicked off by test then buildkite will automatically pick this up for build pipeline.
  3. pipeline.deploy.yml - if this was triggered off by build and then buildkite picks up this automatically for deploy

Hi @ranbir!

Welcome, tho the community! :blush:

It’s great that you have a different pipeline for each case! But we don’t have a naming convention, so you still need to change the buildkite-agent pipeline upload command for each one of them.

buildkite-agent pipeline upload [file] [options...] allows you to change the pipeline of a running build by uploading a YML configuration file. If no configuration file is provided, the command looks for the file in the following locations:

  • buildkite.yml
  • buildkite.yaml
  • buildkite.json
  • .buildkite/pipeline.yml
  • .buildkite/pipeline.yaml
  • .buildkite/pipeline.json
  • buildkite/pipeline.yml
  • buildkite/pipeline.yaml
  • buildkite/pipeline.json

You can also pipe build pipelines to the command allowing you to create scripts that generate dynamic pipelines.

There are two options where to store the configuration files: within your repository, or in Buildkite. For the last case, you can use the YAML steps.

You can read a bit more about customizing the pipeline upload path in here.

Cheers!

Thanks for your response.

1 Like