ci_toolkit 1.4.4 → 1.4.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/ci_toolkit/bitrise_client.rb +5 -4
- data/lib/ci_toolkit/build_status.rb +4 -0
- data/lib/ci_toolkit/github_pr.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df7f5bba49c6c9e1161a6c7d5169173557d6a9f26e42936f92fcde54033563d1
|
4
|
+
data.tar.gz: a56c807056f491f5b08502ad54c5cc70139733be8119ad3bedd8f50fe795a3b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3f63b8e2454b4f9af57a82f99ae6c7c2bb62e39ae87d60246f5d9ad1d1163671af6d975437cacdeef62a788128c910890e77eb27725388f926a608a416c0da4
|
7
|
+
data.tar.gz: 84b8beecd8f3bf472aace619789500d10b0116b1b4b6b11b05039a0ee410ba9cc44cd34f9d9eab8863fc80117bd5e3bf4409a61d77d879d6a52e2d61b02ac8a1
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ci_toolkit (1.4.
|
4
|
+
ci_toolkit (1.4.9)
|
5
5
|
faraday
|
6
6
|
faraday_middleware
|
7
7
|
jwt
|
@@ -46,7 +46,7 @@ GEM
|
|
46
46
|
octokit (4.21.0)
|
47
47
|
faraday (>= 0.9)
|
48
48
|
sawyer (~> 0.8.0, >= 0.5.3)
|
49
|
-
openssl (2.1
|
49
|
+
openssl (2.2.1)
|
50
50
|
ipaddr
|
51
51
|
parallel (1.21.0)
|
52
52
|
parser (3.0.2.0)
|
@@ -49,7 +49,7 @@ module CiToolkit
|
|
49
49
|
})
|
50
50
|
end
|
51
51
|
|
52
|
-
def abort_pull_request_builds(pull_request, branch, commit)
|
52
|
+
def abort_pull_request_builds(pull_request, branch, commit = nil)
|
53
53
|
find_pull_request_builds(pull_request, branch, commit).each do |build|
|
54
54
|
@connection.post("/#{API_VERSION}/apps/#{@app_slug}/builds/#{build["slug"]}/abort", {
|
55
55
|
abort_reason: "Aborting due to other build failed for pull request #{pull_request}"
|
@@ -57,14 +57,15 @@ module CiToolkit
|
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
60
|
-
def find_pull_request_builds(pull_request, branch, commit)
|
60
|
+
def find_pull_request_builds(pull_request, branch, commit = nil)
|
61
61
|
response = @connection.get("/#{API_VERSION}/apps/#{@app_slug}/builds", {
|
62
62
|
branch: branch,
|
63
63
|
pull_request_id: pull_request.to_i,
|
64
64
|
status: 0 # status: 0 == not finished
|
65
65
|
})
|
66
|
-
builds = response.body["data"]
|
67
|
-
filter_builds_by_commit(builds, commit)
|
66
|
+
builds = response.body["data"] || []
|
67
|
+
builds = filter_builds_by_commit(builds, commit) unless commit.nil?
|
68
|
+
builds
|
68
69
|
end
|
69
70
|
|
70
71
|
def filter_builds_by_commit(builds, commit)
|
@@ -36,6 +36,10 @@ module CiToolkit
|
|
36
36
|
@github.create_status(state, @context, @env.app_url, "Finished building #{num_finished}/#{num_total}")
|
37
37
|
end
|
38
38
|
|
39
|
+
def error
|
40
|
+
@github.create_status("error", @context, @env.app_url, "Building failed")
|
41
|
+
end
|
42
|
+
|
39
43
|
private
|
40
44
|
|
41
45
|
def load_counter
|
data/lib/ci_toolkit/github_pr.rb
CHANGED
@@ -84,8 +84,8 @@ module CiToolkit
|
|
84
84
|
def build_types
|
85
85
|
types = []
|
86
86
|
@build_types.each do |type|
|
87
|
-
if comments.include?("#{type} build") || labels.include?("#{type} build")
|
88
|
-
|
87
|
+
if comments.include?("#{type} build") || labels.include?("#{type} build") ||
|
88
|
+
comments.include?(type) || labels.include?(type)
|
89
89
|
types.push(type)
|
90
90
|
end
|
91
91
|
end
|