buildkite-builder 4.4.0 → 4.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 86f89af006c84e916bc75c42fec68f5e308544592b49dcee1b8e0cdde4029bf6
4
- data.tar.gz: ce1c87417d57468896e8f15be3e3678de6c920625b3b070c3b84c3c553ae0c59
3
+ metadata.gz: c47c9c53151cf213174d4be297b48cc832a92d112c0227eea50ee04f7b8a2951
4
+ data.tar.gz: 1d2db37e56f3e5a5dbe13b2cb5b6355fe58a698ef60197ad4bd7d16d07d347cf
5
5
  SHA512:
6
- metadata.gz: bb99d435663020e86296e11f330f5d0f58832486a89febac1b4e199ae48a2a463e2be4906b226f9d654a46b49fc091c33d0481e56f7949c28004db7e17917958
7
- data.tar.gz: 2943c7b52a2e1ef61f9325758255fdd29fe037b3ac658db2ffd298a2ff2ecc2aa544c5aba7b16a2135e7abb7814166feb5608c064e98b2a4077a825f062dd54c
6
+ metadata.gz: 256e662ade3a59a9ed2660b8e954781c3cbe995476187e8c186eadbe9e35a0e9c41ac750e5df8afc932c2643df59b99c51bb35b6dc878cddd7f17580e41b17ba
7
+ data.tar.gz: 40d109033e53bfc4eb80a4bfb9721cd5569d7fe9c608962da1e9003a0d202c1ff3d3edd7b89f1b6239ba3c7a3108513733abd898f1983491c12dc2fdb8c4d528
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ### 4.5.0
2
+ * Do not upload `pipeline.yml` when steps is empty.
3
+
1
4
  ### 4.4.0
2
5
  * Fix multiple arguments for `depends_on`.
3
6
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.4.0
1
+ 4.5.0
@@ -45,20 +45,25 @@ module Buildkite
45
45
 
46
46
  upload_artifacts
47
47
 
48
- # Upload the pipeline.
49
- Tempfile.create(['pipeline', '.yml']) do |file|
50
- file.sync = true
51
- file.write(contents)
52
-
53
- logger.info "+++ :pipeline: Uploading pipeline"
54
- unless Buildkite::Pipelines::Command.pipeline(:upload, file.path)
55
- logger.info "Pipeline upload failed, saving as artifact…"
56
- Buildkite::Pipelines::Command.artifact!(:upload, file.path)
57
- abort
48
+ if data.steps.empty?
49
+ logger.info "+++ :pipeline: No steps defined, skipping pipeline upload"
50
+ else
51
+ # Upload the pipeline.
52
+ Tempfile.create(['pipeline', '.yml']) do |file|
53
+ file.sync = true
54
+ file.write(contents)
55
+
56
+ logger.info "+++ :pipeline: Uploading pipeline"
57
+ unless Buildkite::Pipelines::Command.pipeline(:upload, file.path)
58
+ logger.info "Pipeline upload failed, saving as artifact…"
59
+ Buildkite::Pipelines::Command.artifact!(:upload, file.path)
60
+ abort
61
+ end
58
62
  end
59
- logger.info "+++ :toolbox: Setting job meta-data to #{Buildkite.env.job_id.color(:yellow)}"
60
- Buildkite::Pipelines::Command.meta_data!(:set, Builder.meta_data.fetch(:job), Buildkite.env.step_id)
61
63
  end
64
+
65
+ logger.info "+++ :toolbox: Setting job meta-data to #{Buildkite.env.job_id.color(:yellow)}"
66
+ Buildkite::Pipelines::Command.meta_data!(:set, Builder.meta_data.fetch(:job), Buildkite.env.step_id)
62
67
  end
63
68
 
64
69
  def to_h
@@ -55,6 +55,10 @@ module Buildkite
55
55
  def to_definition
56
56
  @steps.map(&:to_h)
57
57
  end
58
+
59
+ def empty?
60
+ @steps.empty? || (@steps.all? { |step| step.is_a?(Pipelines::Steps::Group) && step.steps.empty? })
61
+ end
58
62
  end
59
63
  end
60
64
  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.0
4
+ version: 4.5.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: 2023-09-27 00:00:00.000000000 Z
12
+ date: 2023-10-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rainbow
@@ -174,7 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
174
174
  - !ruby/object:Gem::Version
175
175
  version: '0'
176
176
  requirements: []
177
- rubygems_version: 3.3.26
177
+ rubygems_version: 3.3.13
178
178
  signing_key:
179
179
  specification_version: 4
180
180
  summary: A gem for programmatically creating Buildkite pipelines.