ci_toolkit 1.4.9 → 1.4.13

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: df7f5bba49c6c9e1161a6c7d5169173557d6a9f26e42936f92fcde54033563d1
4
- data.tar.gz: a56c807056f491f5b08502ad54c5cc70139733be8119ad3bedd8f50fe795a3b7
3
+ metadata.gz: 8ca9241717a55023bbc883936c7ea991130d731343cda78c48e392c37d00384d
4
+ data.tar.gz: 72a99fe032af182bdeec1b7c6b8ba335bb2c90b55f5236598f1ad9ccd833fd69
5
5
  SHA512:
6
- metadata.gz: b3f63b8e2454b4f9af57a82f99ae6c7c2bb62e39ae87d60246f5d9ad1d1163671af6d975437cacdeef62a788128c910890e77eb27725388f926a608a416c0da4
7
- data.tar.gz: 84b8beecd8f3bf472aace619789500d10b0116b1b4b6b11b05039a0ee410ba9cc44cd34f9d9eab8863fc80117bd5e3bf4409a61d77d879d6a52e2d61b02ac8a1
6
+ metadata.gz: b560f3ed3c5bc90e4f85e12fc0bb795c961fd3adba2090821756ca9cbe6da3e9f936cd040fdad2809ab01b31db5d65b775083cd39c0a83bf01dfb974b8bbbfe8
7
+ data.tar.gz: 6ed5a5cb7fbc4c449469dadcfd937c4092582a9e2251771416299a78683f6dd84a584cb2e442dddb168d3b51b059ddec4bf39c1606673f07c6acfbde7ce7a86b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ci_toolkit (1.4.9)
4
+ ci_toolkit (1.4.13)
5
5
  faraday
6
6
  faraday_middleware
7
7
  jwt
@@ -15,7 +15,7 @@ GEM
15
15
  addressable (2.8.0)
16
16
  public_suffix (>= 2.0.2, < 5.0)
17
17
  ast (2.4.2)
18
- date (3.2.0)
18
+ date (3.2.1)
19
19
  diff-lcs (1.4.4)
20
20
  docile (1.4.0)
21
21
  faraday (1.8.0)
@@ -13,12 +13,14 @@ module CiToolkit
13
13
  def initialize(options = {
14
14
  build_number: ENV["BITRISE_BUILD_NUMBER"],
15
15
  token: ENV["BITRISE_TOKEN"],
16
- app_slug: ENV["BITRISE_APP_SLUG"]
16
+ app_slug: ENV["BITRISE_APP_SLUG"],
17
+ build_slug: ENV["BITRISE_BUILD_SLUG"]
17
18
  },
18
19
  faraday = nil)
19
20
  @build_number = options[:build_number].to_i
20
21
  @token = options[:token]
21
22
  @app_slug = options[:app_slug]
23
+ @build_slug = options[:build_slug]
22
24
  @connection = faraday || create_connection
23
25
  end
24
26
 
@@ -51,6 +53,8 @@ module CiToolkit
51
53
 
52
54
  def abort_pull_request_builds(pull_request, branch, commit = nil)
53
55
  find_pull_request_builds(pull_request, branch, commit).each do |build|
56
+ next if build["slug"] == @build_slug
57
+
54
58
  @connection.post("/#{API_VERSION}/apps/#{@app_slug}/builds/#{build["slug"]}/abort", {
55
59
  abort_reason: "Aborting due to other build failed for pull request #{pull_request}"
56
60
  })
@@ -50,9 +50,9 @@ release branch with semantic versioning, eg. release/x.y.z"
50
50
  end
51
51
 
52
52
  def tag_name(build_number = nil)
53
- return "#{version}-build.#{build_number}" if build_number
53
+ return version.to_s if version.include?("-build.") || build_number.nil?
54
54
 
55
- version.to_s
55
+ "#{version}-build.#{build_number}"
56
56
  end
57
57
  end
58
58
  end
@@ -9,7 +9,7 @@ module CiToolkit
9
9
  end
10
10
 
11
11
  def latest_tag
12
- describe = "git describe --abbrev=0"
12
+ describe = "git describe --tags --abbrev=0"
13
13
  return `#{describe}`.gsub("\n", "") unless @dir
14
14
 
15
15
  `cd #{@dir} && #{describe}`.gsub("\n", "")
@@ -12,9 +12,9 @@ module CiToolkit
12
12
  end
13
13
 
14
14
  def for_new_build(name, version_name, tag)
15
- "#### New `#{name}` build deployed 🚀\nVersion **#{version_name}** with
16
- build number **#{@build.number}** on tag **#{tag}** deployed
17
- from [this](#{@build.url}) build"
15
+ "#### New `#{name}` build deployed 🚀\nVersion **#{version_name}** with\
16
+ build number **#{@build.number}** on tag **#{tag}** deployed\
17
+ from [this](#{@build.url}) build"
18
18
  end
19
19
 
20
20
  def for_build_failure(reason)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ci_toolkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.9
4
+ version: 1.4.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gero Keller
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-11-08 00:00:00.000000000 Z
11
+ date: 2021-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday