buildkite-builder 3.2.0 → 3.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/VERSION +1 -1
- data/lib/buildkite/builder/extensions/sub_pipelines.rb +36 -35
- data/lib/buildkite/builder/pipeline_collection.rb +1 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25e5b7c5ee30bb570f214b7061ecc8c9dee2e118e0116ddfe2cc3d070fb2bed5
|
4
|
+
data.tar.gz: a9bad724efa96a3a613eb3c7e3e016c0697d9d4c6e66deba2e09d3056651aad9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e6758542d63fdfe9b824a5c47765f01ed8ed8aea0130da1249aa9e2f6c7b593ee4bde1ea69b92b897d1ef8e0f1a9df235dddd87a36b0c807496bfefc98ad993
|
7
|
+
data.tar.gz: d91ce92070ebacf6b22477c6b16a353578d6c52231c20e6f21f45675ee9e21f889263aa4454b1c5173c069984ae34fbd1b16e9037fdb479ab7cf9447c3cf97e4
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
## 3.3.2
|
2
|
+
* Fix subpipeline trigger step attributes leak to subpipeline.
|
3
|
+
|
4
|
+
## 3.3.1
|
5
|
+
* Add support to iterate over subpipelines.
|
6
|
+
* Allow build options to be passed to subpipelines.
|
7
|
+
|
8
|
+
## 3.3.0
|
9
|
+
* Remove arguments in sub-pipeline's trigger step setup and use dsl delegation instead.
|
10
|
+
|
1
11
|
## 3.2.0
|
2
12
|
* Remove `template` from sub-pipeline trigger step setup and use arguments instead.
|
3
13
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.2
|
1
|
+
3.3.2
|
@@ -9,8 +9,16 @@ module Buildkite
|
|
9
9
|
|
10
10
|
attr_reader :data, :name, :dsl
|
11
11
|
|
12
|
-
|
12
|
+
# These attributes are for triggered step
|
13
|
+
attribute :label
|
13
14
|
attribute :key
|
15
|
+
attribute :skip
|
16
|
+
attribute :if, as: :condition
|
17
|
+
attribute :depends_on, append: true
|
18
|
+
attribute :allow_dependency_failure
|
19
|
+
attribute :branches
|
20
|
+
attribute :async
|
21
|
+
attribute :build
|
14
22
|
|
15
23
|
def self.to_sym
|
16
24
|
name.split('::').last.downcase.to_sym
|
@@ -37,13 +45,12 @@ module Buildkite
|
|
37
45
|
end
|
38
46
|
|
39
47
|
def to_h
|
40
|
-
attributes = super
|
41
48
|
# Merge envs from main pipeline, since ruby does not have `reverse_merge` and
|
42
49
|
# `data` does not allow keys override, we have to reset the data hash per key.
|
43
50
|
@context.data.env.merge(data.env).each do |key, value|
|
44
51
|
data.env[key] = value
|
45
52
|
end
|
46
|
-
|
53
|
+
data.to_definition
|
47
54
|
end
|
48
55
|
|
49
56
|
def method_missing(method_name, *args, **kwargs, &_block)
|
@@ -60,44 +67,38 @@ module Buildkite
|
|
60
67
|
end
|
61
68
|
|
62
69
|
dsl do
|
63
|
-
def pipeline(name,
|
70
|
+
def pipeline(name, &block)
|
64
71
|
raise "Subpipeline must have a name" if name.empty?
|
65
72
|
raise "Subpipeline does not allow nested in another Subpipeline" if context.is_a?(Buildkite::Builder::Extensions::SubPipelines::Pipeline)
|
66
73
|
|
67
74
|
sub_pipeline = Buildkite::Builder::Extensions::SubPipelines::Pipeline.new(name, context, &block)
|
68
75
|
context.data.pipelines.add(sub_pipeline)
|
69
76
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
branches context[:branches] if context[:branches]
|
96
|
-
condition context[:condition] if context[:condition]
|
97
|
-
depends_on *context[:depends_on] if context[:depends_on]
|
98
|
-
allow_dependency_failure context[:allow_dependency_failure] || false
|
99
|
-
skip context[:skip] || false
|
100
|
-
end
|
77
|
+
trigger_step = context.data.steps.add(Pipelines::Steps::Trigger)
|
78
|
+
trigger_step.trigger(name)
|
79
|
+
|
80
|
+
build_options = {
|
81
|
+
message: '${BUILDKITE_MESSAGE}',
|
82
|
+
commit: '${BUILDKITE_COMMIT}',
|
83
|
+
branch: '${BUILDKITE_BRANCH}',
|
84
|
+
env: {
|
85
|
+
BUILDKITE_PULL_REQUEST: '${BUILDKITE_PULL_REQUEST}',
|
86
|
+
BUILDKITE_PULL_REQUEST_BASE_BRANCH: '${BUILDKITE_PULL_REQUEST_BASE_BRANCH}',
|
87
|
+
BUILDKITE_PULL_REQUEST_REPO: '${BUILDKITE_PULL_REQUEST_REPO}',
|
88
|
+
BKB_SUBPIPELINE_FILE: sub_pipeline.pipeline_yml
|
89
|
+
}
|
90
|
+
}
|
91
|
+
build_options.merge!(sub_pipeline.build) if sub_pipeline.build
|
92
|
+
|
93
|
+
trigger_step.build(build_options)
|
94
|
+
trigger_step.key(sub_pipeline.key || "subpipeline_#{name}_#{context.data.pipelines.count}")
|
95
|
+
trigger_step.label(sub_pipeline.label || name.capitalize)
|
96
|
+
trigger_step.async(sub_pipeline.async || false)
|
97
|
+
trigger_step.branches(sub_pipeline.branches) if sub_pipeline.branches
|
98
|
+
trigger_step.condition(sub_pipeline.condition) if sub_pipeline.condition
|
99
|
+
trigger_step.depends_on(*sub_pipeline.get('depends_on')) if sub_pipeline.get('depends_on')
|
100
|
+
trigger_step.allow_dependency_failure(sub_pipeline.allow_dependency_failure || false)
|
101
|
+
trigger_step.skip(sub_pipeline.skip || false)
|
101
102
|
end
|
102
103
|
end
|
103
104
|
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: 3.2
|
4
|
+
version: 3.3.2
|
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: 2022-
|
12
|
+
date: 2022-08-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rainbow
|
@@ -192,7 +192,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
192
192
|
- !ruby/object:Gem::Version
|
193
193
|
version: '0'
|
194
194
|
requirements: []
|
195
|
-
rubygems_version: 3.
|
195
|
+
rubygems_version: 3.3.13
|
196
196
|
signing_key:
|
197
197
|
specification_version: 4
|
198
198
|
summary: A gem for programmatically creating Buildkite pipelines.
|