buildkite-builder 3.5.0 → 3.6.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: 64089d229e28dcf07061f4a32178cbf29fc157f2004e03adb84a800f24c2b8fd
4
- data.tar.gz: d4faa31aac7205a07c29ef2766ae3067079d6d72ddb938adfdcec943babd564c
3
+ metadata.gz: 93d05d1f845781bebfd8b0ad224f1b50ca3d48237817a7ae4391add514dc6103
4
+ data.tar.gz: 2c33310049a5c2c47e00813bbc02304c9dd8fe2b8842e013ea03ace5e5e607d0
5
5
  SHA512:
6
- metadata.gz: 67c3325a7b86690c80d771a4cf7738718f1d072481cd23a2b21e9cd1bdb9c9a76b96fc35bb270d09c2ca1e69fbbd7e1d81c8b334a6973e4b148a27ebbf98c504
7
- data.tar.gz: 7f4263163c198d8158fbc93e52dab34369ec51e5957860f4203d602ed6c7e445c018d8cf842584fafbfa2e9d44e0722e0ded99efb754d373bbff96f45bb676c2
6
+ metadata.gz: 03675ba911feade1199a7ca2b86a7656107160e6b2994f0994a5cc8cc9b1e24e28c6e132f05e335827da1f4c191a7a07854707ba15015348734b67fa078eb2b7
7
+ data.tar.gz: ad283bfdeb754f8fb04373d39a9b383e3d66fcfefc51ed41627958b144993d9b21ceec3e8f41af607163334895c3e2f0da0ce02f92b5ab31f6be04ce47240d29
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 3.6.0
2
+ * `Buildkite::Pipelines::Command#run` now uses `Open3.capture3` to run system commands, and accepts an optional arg `capture`. When `capture` is true, it returns the stdout of the command. `capture` is true for the meta_data subcommands `get` and `keys` and for the artifact subcommands `shasum` and `search`.
3
+
1
4
  ## 3.5.0
2
5
  * `plugin` registrations now takes an optional default attributes hash as the third argument.
3
6
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.5.0
1
+ 3.6.0
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'open3'
4
+
3
5
  module Buildkite
4
6
  module Pipelines
5
7
  class Command
@@ -17,7 +19,12 @@ module Buildkite
17
19
  end
18
20
 
19
21
  def artifact(subcommand, *args)
20
- new(:artifact, subcommand, *args).run
22
+ capture = case subcommand.to_s
23
+ when 'shasum', 'search' then true
24
+ else false
25
+ end
26
+
27
+ new(:artifact, subcommand, *args).run(capture: capture)
21
28
  end
22
29
 
23
30
  def annotate(body, *args)
@@ -25,7 +32,12 @@ module Buildkite
25
32
  end
26
33
 
27
34
  def meta_data(subcommand, *args)
28
- new(:'meta-data', subcommand, *args).run
35
+ capture = case subcommand.to_s
36
+ when 'get', 'keys' then true
37
+ else false
38
+ end
39
+
40
+ new(:'meta-data', subcommand, *args).run(capture: capture)
29
41
  end
30
42
  end
31
43
 
@@ -42,8 +54,9 @@ module Buildkite
42
54
  @args = transform_args(args)
43
55
  end
44
56
 
45
- def run
46
- system(*to_a)
57
+ def run(capture: false)
58
+ stdout, _, status = Open3.capture3(*to_a)
59
+ capture ? stdout : status.success?
47
60
  end
48
61
 
49
62
  private
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.5.0
4
+ version: 3.6.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: 2022-10-21 00:00:00.000000000 Z
12
+ date: 2022-11-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rainbow