buildkite-builder 4.18.0 → 4.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +55 -0
- data/VERSION +1 -1
- data/lib/buildkite/pipelines/helpers/matrix.rb +19 -0
- data/lib/buildkite/pipelines/helpers.rb +1 -0
- data/lib/buildkite/pipelines/steps/command.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 766b0ac1d07fc726b376e905fbfaa30864055c458bd0f3190247ec56a853768c
|
4
|
+
data.tar.gz: 4e79fe7cc6b1913afcd311ea96349242653f45ce0b541e7cb452dcb9e5366460
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7313796c22a45884e1120ef293279f3473eb17da52e5c93bd71c5cc8c5514725fe0428ebe25a74b2adc728634bbeb256afc81e2625e2f4ae90d4f4ae4b7d92fc
|
7
|
+
data.tar.gz: 521ce5fdfeace7b5f23049cbf5e15df6a195f31d8aa7f71bbd856a2daa22a31ed9b5de405c5c330d1bb4b2696111c572d9bf3281dee72de403ee9ca7c365f51b
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -143,6 +143,61 @@ Buildkite::Builder.pipeline do
|
|
143
143
|
end
|
144
144
|
```
|
145
145
|
|
146
|
+
### Extensions
|
147
|
+
|
148
|
+
Extensions provide additional flexibility to run code and encapsulate reusable patterns in your pipelines. Think of extensions as Ruby modules that let you define custom DSL, step templates, and shared logic that can be used across multiple pipelines.
|
149
|
+
|
150
|
+
Extensions are useful when you want to standardize how certain steps are defined, or when you want to use or share complex logic (like deployment, notifications, or test orchestration).
|
151
|
+
|
152
|
+
`.buildkite/pipelines/foobar-widget/extensions/deploy_extension.rb`
|
153
|
+
|
154
|
+
```ruby
|
155
|
+
class DeployExtension < Buildkite::Builder::Extension
|
156
|
+
dsl do
|
157
|
+
def deploy_step(&block)
|
158
|
+
command(:deploy, &block)
|
159
|
+
end
|
160
|
+
end
|
161
|
+
end
|
162
|
+
```
|
163
|
+
|
164
|
+
`.buildkite/pipelines/foobar-widget/pipeline.rb`
|
165
|
+
|
166
|
+
```ruby
|
167
|
+
Buildkite::Builder.pipeline do
|
168
|
+
deploy_step do
|
169
|
+
label "Deploy to production (EU)"
|
170
|
+
command "bundle exec deploy --env production --region eu"
|
171
|
+
end
|
172
|
+
end
|
173
|
+
```
|
174
|
+
|
175
|
+
#### Extension Templates
|
176
|
+
|
177
|
+
Extensions can also provide multiple templates for different scenarios:
|
178
|
+
|
179
|
+
```ruby
|
180
|
+
class TestExtension < Buildkite::Builder::Extension
|
181
|
+
template :default do
|
182
|
+
command "bundle exec rspec"
|
183
|
+
end
|
184
|
+
|
185
|
+
template :rubocop do
|
186
|
+
command "bundle exec rubocop"
|
187
|
+
end
|
188
|
+
end
|
189
|
+
```
|
190
|
+
|
191
|
+
And used like this in the pipeline file:
|
192
|
+
|
193
|
+
```ruby
|
194
|
+
command(TestExtension) # Uses the default template
|
195
|
+
|
196
|
+
command(TestExtension.template(:rubocop)) do
|
197
|
+
label "Custom Rubocop label"
|
198
|
+
end
|
199
|
+
```
|
200
|
+
|
146
201
|
## Development
|
147
202
|
|
148
203
|
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.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
4.
|
1
|
+
4.19.0
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Buildkite
|
4
|
+
module Pipelines
|
5
|
+
module Helpers
|
6
|
+
module Matrix
|
7
|
+
def matrix(value = nil, setup: nil)
|
8
|
+
if value.nil? && setup.nil?
|
9
|
+
get(:matrix)
|
10
|
+
elsif setup
|
11
|
+
set(:matrix, { setup: setup })
|
12
|
+
else
|
13
|
+
set(:matrix, value)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: buildkite-builder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.19.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ngan Pham
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2025-
|
12
|
+
date: 2025-07-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rainbow
|
@@ -154,6 +154,7 @@ files:
|
|
154
154
|
- lib/buildkite/pipelines/helpers/depends_on.rb
|
155
155
|
- lib/buildkite/pipelines/helpers/key.rb
|
156
156
|
- lib/buildkite/pipelines/helpers/label.rb
|
157
|
+
- lib/buildkite/pipelines/helpers/matrix.rb
|
157
158
|
- lib/buildkite/pipelines/helpers/plugins.rb
|
158
159
|
- lib/buildkite/pipelines/helpers/retry.rb
|
159
160
|
- lib/buildkite/pipelines/helpers/skip.rb
|