README.md in buildkite-builder-3.0.0 vs README.md in buildkite-builder-3.1.0
- old
+ new
@@ -46,11 +46,11 @@
At its core, BKB is really just a YAML builder. This tool allows you to scale your needs when it comes to building a Buildkite pipeline. Your pipeline can be as straight forward as you'd like, or as complex as you need. Since you have Ruby at your disposal, you can do some cool things like:
- Perform pre-build code/diff analysis to determine whether or not to to add a step to the pipeline.
- Reorder pipeline steps dynamically.
- Augment your pipeline steps with BKB processors.
-
+
### Pipeline Files
Your repo can contain as many pipeline definitions as you'd like. By convention, pipeline file structure are as such:
```console
@@ -72,13 +72,13 @@
Buildkite::Builder.pipeline do
command do
label "Rspec", emoji: :rspec
command "bundle exec rspec"
end
-
+
wait
-
+
trigger do
trigger "deploy-pipeline"
end
end
```
@@ -125,16 +125,46 @@
`.buildkite/pipelines/foobar-widget/pipeline.rb`
```ruby
Buildkite::Builder.pipeline do
command(:rspec)
-
+
# Reuse and agument templates on the fly.
command(:rspec) do
label "Run RSpec again!"
end
end
```
+
+### Subpipeline
+
+While triggering another pipeline, you can predefine subpipeline's steps using `pipeline(NAME_OF_SUBPIPELINE)` in the main pipeline's `pipeline.rb` file and share with main pipeline's plugins and templates definition.
+
+`.buildkite/pipelines/pipeline-triggerer/pipeline.rb`
+
+```ruby
+Buildkite::Builder.pipeline do
+ pipeline('rspec-pipeline') do
+ command do
+ label "Run RSpec in separate pipeline"
+ end
+ end
+end
+```
+
+Inside your Buildkite pipeline setup, you can do the following:
+
+In `https://buildkite.com/your-org/rspec-pipeline/steps`
+
+```yaml
+steps:
+ - label: ":pipeline:"
+ commands:
+ - buildkite-agent artifact download $BKB_SUBPIPELINE_FILE . --build $BUILDKITE_TRIGGERED_FROM_BUILD_ID
+ - buildkite-agent pipeline upload $BKB_SUBPIPELINE_FILE
+```
+
+This will upload the pregenerated `pipeline.yml` to `rspec-pipeline`.
## Development
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.