ci_toolkit 1.4.7 → 1.4.11
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_status.rb +4 -4
- 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: ee76db372a182e446e5eded76144c48168dd732698ceadf6aed9786a4170f7df
|
4
|
+
data.tar.gz: eabd9e5d140b76dee0d8e09e53932bec6ef78d453521b5202028b9192b4f5f00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99d30cd39b55b0ab6f08a726d233a9d5e9edbedf35f2807191bac3b77c131b2214f3f393acd714ec5c38f578e38f7e05defefb4ec41cc4dd783ada9bd4bae6f4
|
7
|
+
data.tar.gz: 719c0db775f877d3fb72a728a63b7bd9fe7eb9beb227b9816198aed4a0e9a75832c1038bbe07aa5cab9aba9d3c7eb8845023ea2b984aec41c25ed07858824547
|
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)
|
@@ -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
|
@@ -46,9 +50,5 @@ module CiToolkit
|
|
46
50
|
build_counter = description[%r{(\d/\d)}] || "0/0"
|
47
51
|
{ num_finished: build_counter.split("/")[0].to_i, num_total: build_counter.split("/")[1].to_i }
|
48
52
|
end
|
49
|
-
|
50
|
-
def error
|
51
|
-
@github.create_status("error", @context, @env.app_url, "Building failed")
|
52
|
-
end
|
53
53
|
end
|
54
54
|
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.11
|
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
|