This repository is an example Buildkite pipeline that shows how to programmatically generate a build pipeline, allowing you to customize and distribute your build jobs however you wish.
When a build is start it runs a single job first. This job executes .buildkite/pipeline.sh | buildkite-agent pipeline upload
.
This .buildkite/pipeline.sh script does the following:
- Creates a separate test step for each directory in specs
- Adds a deploy step at the end only if the build is on the master branch
For a non-master branch build it generates:
steps:
- command: "specs/controllers/test.sh"
label: "controllers"
- command: "specs/features/test.sh"
label: "features"
- command: "specs/models/test.sh"
label: "models"
For a master branch build it generates:
steps:
- command: "specs/controllers/test.sh"
label: "controllers"
- command: "specs/features/test.sh"
label: "features"
- command: "specs/models/test.sh"
label: "models"
- wait
- command: "echo Deploy!"
label: ":rocket:"
What else could you do? The possibilities are endless. For example Jobsworth is a high-level tool that uses this to create deployments, rollbacks, QA steps, etc.
See Licence.md (MIT)