fastlane-plugin-ci_changelog 0.5.5 → 0.5.6
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f52ebce0dd70e93ac96f3b4657c35605ce07fb7fc2aca8422ad896649f4ff875
|
4
|
+
data.tar.gz: a0e353bfee554c35beed63132581feb25570ee8d9b3c1f264b0d0600708c4da8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1fa7f713f838b3fb68dae763554fe1c50bcbc14a26d545d88f201abdb0776f08fce8fe7b92e2fe3294d213ee2a844defb03ba8547d7e95047c55ee4540623c8
|
7
|
+
data.tar.gz: babd1c34757f6a6a90cb558c177a761d0c59b584d82151103bdf78b8c0c58ff7ecd9abb80b738d7baea2843a95033ba112614725547a92e3a840eed80503cfa8
|
@@ -76,8 +76,10 @@ module Fastlane
|
|
76
76
|
build_branch = ENV['GIT_BRANCH']
|
77
77
|
build_number = ENV['BUILD_NUMBER'].to_i
|
78
78
|
loop do
|
79
|
+
build_url = "#{ENV['JOB_URL']}#{build_number}/api/json"
|
80
|
+
UI.verbose("Fetching changelog #{build_url}")
|
81
|
+
UI.verbose("- Branch #{build_branch}")
|
79
82
|
begin
|
80
|
-
build_url = "#{ENV['JOB_URL']}#{build_number}/api/json"
|
81
83
|
res =
|
82
84
|
if Helper::CiChangelogHelper.determine_jenkins_basic_auth?
|
83
85
|
HTTP.basic_auth(user: @params.fetch(:jenkins_user), pass: @params.fetch(:jenkins_token))
|
@@ -88,8 +90,6 @@ module Fastlane
|
|
88
90
|
|
89
91
|
if res.code == 200
|
90
92
|
build_status, data = Helper::CiChangelogHelper.dump_jenkins_commits(res.body, build_branch)
|
91
|
-
UI.verbose("Fetching changelog #{build_url}")
|
92
|
-
UI.verbose("- Branch #{build_branch}")
|
93
93
|
UI.verbose("- Status #{build_status}")
|
94
94
|
UI.verbose("- Changelog #{data}")
|
95
95
|
|
@@ -99,10 +99,15 @@ module Fastlane
|
|
99
99
|
end
|
100
100
|
|
101
101
|
build_number -= 1
|
102
|
-
|
103
102
|
break if build_number <= 0
|
104
|
-
rescue
|
103
|
+
rescue JSON::ParserError => e
|
104
|
+
UI.verbose(e.message)
|
105
|
+
build_number -= 1
|
106
|
+
break if build_number <= 0
|
107
|
+
rescue HTTP::Error => e
|
105
108
|
# NOTE: break out of loop if build setted keep max builds count
|
109
|
+
UI.verbose(e.message)
|
110
|
+
UI.verbose(e.backtrace.join("\n"))
|
106
111
|
break
|
107
112
|
end
|
108
113
|
end
|
@@ -131,25 +136,35 @@ module Fastlane
|
|
131
136
|
build_number = ENV['CI_BUILD_ID'].to_i
|
132
137
|
loop do
|
133
138
|
build_url = "#{@params[:gitlab_url]}/api/v3/projects/#{ENV['CI_PROJECT_ID']}/builds/#{build_number}"
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
139
|
+
UI.verbose("Fetching changelog #{build_url}")
|
140
|
+
|
141
|
+
begin
|
142
|
+
res = HTTP.headers('PRIVATE-TOKEN' => @params[:gitlab_private_token]).get(build_url)
|
143
|
+
if res.code == 200
|
144
|
+
build_status, data = Helper::CiChangelogHelper.dump_gitlab_commits(res.body)
|
145
|
+
UI.verbose("- Status #{build_status}")
|
146
|
+
UI.verbose("- Changelog #{data}")
|
147
|
+
|
148
|
+
if build_status == true
|
149
|
+
commits = data if commits.empty?
|
150
|
+
fetch_correct_changelog = true
|
151
|
+
else
|
152
|
+
commits = commits.empty? ? data : commits.concat(data)
|
153
|
+
loop_count += 1
|
154
|
+
end
|
148
155
|
end
|
149
|
-
|
150
|
-
build_number -= 1
|
156
|
+
build_number -= 1
|
151
157
|
|
152
|
-
|
158
|
+
break if fetch_correct_changelog || build_number <= 0
|
159
|
+
rescue JSON::ParserError => e
|
160
|
+
UI.verbose(e.message)
|
161
|
+
build_number -= 1
|
162
|
+
break if fetch_correct_changelog || build_number <= 0
|
163
|
+
rescue HTTP::Error => e
|
164
|
+
UI.verbose(e.message)
|
165
|
+
UI.verbose(e.backtrace.join("\n"))
|
166
|
+
break
|
167
|
+
end
|
153
168
|
end
|
154
169
|
|
155
170
|
Helper::CiChangelogHelper.store_sharedvalue(SharedValues::CICL_CHANGELOG, commits.to_json)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-ci_changelog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- icyleaf
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-06-
|
11
|
+
date: 2019-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http
|