ci_toolkit 1.4.8 → 1.4.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/ci_toolkit/bitrise_client.rb +10 -5
- data/lib/ci_toolkit/build.rb +2 -2
- data/lib/ci_toolkit/git.rb +1 -1
- data/lib/ci_toolkit/pr_messenger_text.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf57d831af4f6cf35645bf6badfa46e4e5c4a248b71073e913c7b00d916d9e29
|
4
|
+
data.tar.gz: '0178662a1ea410b9dd1b653a5da8c7afd9230825e51b3f8da3f57e857d925907'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37b8173921e346aaeb9cf254ed372d239abd5a23b53f0357139ad85876c3f5d9f832d60cde27046a343302e3d1eca766c8a819580af8c2c5cc1235c9d8a68716
|
7
|
+
data.tar.gz: 2abe3d539e171cafdea9fce063300ef331e7be7c96fa50c56b437d51588019a8c30ece24c5bb5b4236176814e81481317c9adbf291f9cac18d115c522c5557fb
|
data/Gemfile.lock
CHANGED
@@ -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
|
|
@@ -49,22 +51,25 @@ module CiToolkit
|
|
49
51
|
})
|
50
52
|
end
|
51
53
|
|
52
|
-
def abort_pull_request_builds(pull_request, branch, commit)
|
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
|
})
|
57
61
|
end
|
58
62
|
end
|
59
63
|
|
60
|
-
def find_pull_request_builds(pull_request, branch, commit)
|
64
|
+
def find_pull_request_builds(pull_request, branch, commit = nil)
|
61
65
|
response = @connection.get("/#{API_VERSION}/apps/#{@app_slug}/builds", {
|
62
66
|
branch: branch,
|
63
67
|
pull_request_id: pull_request.to_i,
|
64
68
|
status: 0 # status: 0 == not finished
|
65
69
|
})
|
66
|
-
builds = response.body["data"]
|
67
|
-
filter_builds_by_commit(builds, commit)
|
70
|
+
builds = response.body["data"] || []
|
71
|
+
builds = filter_builds_by_commit(builds, commit) unless commit.nil?
|
72
|
+
builds
|
68
73
|
end
|
69
74
|
|
70
75
|
def filter_builds_by_commit(builds, commit)
|
data/lib/ci_toolkit/build.rb
CHANGED
@@ -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 "
|
53
|
+
return version.to_s if version.include?("-build.") || build_number.nil?
|
54
54
|
|
55
|
-
version
|
55
|
+
"#{version}-build.#{build_number}"
|
56
56
|
end
|
57
57
|
end
|
58
58
|
end
|
data/lib/ci_toolkit/git.rb
CHANGED
@@ -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
|
-
|
17
|
-
|
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.
|
4
|
+
version: 1.4.12
|
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-
|
11
|
+
date: 2021-11-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|