fastlane 2.18.1 → 2.18.2

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
  SHA1:
3
- metadata.gz: d9d3c96a177ba6a9c1dee9d00010f9dfe7ef58ea
4
- data.tar.gz: c54cb232450a7a3c6d3713d19175f41c38df0735
3
+ metadata.gz: f95259118de35e5f0bf061d30a5fef49137b2837
4
+ data.tar.gz: 4a9ef9be67de346ec9334f2a77907d75d5d56b8f
5
5
  SHA512:
6
- metadata.gz: 2f5b27fee4f39d82d36024196cd7d8310de46e75c7d10f0bb8eca16240c7dc1131d142f21928b38170133b6f69e5999efa0a8cdb2494f7250631bb8006effa39
7
- data.tar.gz: 69b350cc9901f2439b15531109eacfe49936ba1998a1bcb441aacd8be29a2178cb07a83fac6d3dc3924437772ef5cf987c517244a0b660449a265c0f552533ca
6
+ metadata.gz: 3649cbb7a9bc0bcf97e2592610a3812b37a04c955c437ec9ff363c983d4cc233d894b0b449d962df58f62a74fd833669ec56198179951caa2641fab911a87ec7
7
+ data.tar.gz: 42ca182fd45131c07990be51b864696a8b1b7b2fbf924a38202592e2039b1a55f987e26bf2e9c623dee73c85ac1f1e2caaa905a9a71eef6530185682e6ac35c9
@@ -39,7 +39,7 @@ module Deliver
39
39
  end
40
40
  else
41
41
  UI.message("Selecting the latest build...")
42
- build = FastlaneCore::BuildWatcher.wait_for_build(app, options[:app_platform], sleep_time)
42
+ build = wait_for_build(app)
43
43
  end
44
44
  UI.message("Selecting build #{build.train_version} (#{build.build_version})...")
45
45
 
@@ -48,5 +48,40 @@ module Deliver
48
48
 
49
49
  UI.success("Successfully selected build")
50
50
  end
51
+
52
+ def wait_for_build(app)
53
+ UI.user_error!("Could not find app with app identifier") unless app
54
+
55
+ start = Time.now
56
+
57
+ loop do
58
+ build = find_build(app.latest_version.candidate_builds)
59
+ return build if build.processing == false
60
+
61
+ UI.message("Waiting iTunes Connect processing for build #{build.train_version} (#{build.build_version})... this might take a while...")
62
+ if (Time.now - start) > (60 * 5)
63
+ UI.message("")
64
+ UI.message("You can tweet: \"iTunes Connect #iosprocessingtime #{((Time.now - start) / 60).round} minutes\"")
65
+ end
66
+ sleep 30
67
+ end
68
+ nil
69
+ end
70
+
71
+ def find_build(candidate_builds)
72
+ build = nil
73
+ candidate_builds.each do |b|
74
+ if !build or b.upload_date > build.upload_date
75
+ build = b
76
+ end
77
+ end
78
+
79
+ unless build
80
+ UI.error(candidate_builds)
81
+ UI.crash!("Could not find build")
82
+ end
83
+
84
+ return build
85
+ end
51
86
  end
52
87
  end
@@ -1,4 +1,4 @@
1
1
  module Fastlane
2
- VERSION = '2.18.1'.freeze
2
+ VERSION = '2.18.2'.freeze
3
3
  DESCRIPTION = "The easiest way to automate beta deployments and releases for your iOS and Android apps".freeze
4
4
  end
@@ -5,7 +5,6 @@ require 'fastlane_core/globals'
5
5
  # Ruby monkey-patches - should be before almost all else
6
6
  require 'fastlane_core/core_ext/string'
7
7
 
8
- require 'fastlane_core/build_watcher'
9
8
  require 'fastlane_core/env'
10
9
  require 'fastlane_core/feature/feature'
11
10
  require 'fastlane_core/features'
@@ -31,7 +31,8 @@ module Pilot
31
31
  end
32
32
 
33
33
  UI.message("If you want to skip waiting for the processing to be finished, use the `skip_waiting_for_build_processing` option")
34
- uploaded_build = FastlaneCore::BuildWatcher.wait_for_build(app, platform, config[:wait_processing_interval].to_i)
34
+ uploaded_build = wait_for_processing_build(options, platform) # this might take a while
35
+
35
36
  distribute(options, uploaded_build)
36
37
  end
37
38
 
@@ -123,6 +124,71 @@ module Pilot
123
124
  options[:changelog].to_s.length > 0 or options[:beta_app_description].to_s.length > 0 or options[:beta_app_feedback_email].to_s.length > 0
124
125
  end
125
126
 
127
+ # This method will takes care of checking for the processing builds every few seconds
128
+ # @return [Build] The build that we just uploaded
129
+ def wait_for_processing_build(options, platform)
130
+ # the upload date of the new buid
131
+ # we use it to identify the build
132
+ start = Time.now
133
+ wait_processing_interval = config[:wait_processing_interval].to_i
134
+ latest_build = nil
135
+ UI.message("Waiting for iTunes Connect to process the new build")
136
+ must_update_build_info = config[:update_build_info_on_upload]
137
+ loop do
138
+ sleep(wait_processing_interval)
139
+
140
+ # before we look for processing builds, we need to ensure that there
141
+ # is a build train for this application; new applications don't
142
+ # build trains right away, and if we don't do this check, we will
143
+ # get break out of this loop and then generate an error later when we
144
+ # have a nil build
145
+ if app.build_trains(platform: platform).count == 0
146
+ UI.message("New application; waiting for build train to appear on iTunes Connect")
147
+ else
148
+ builds = app.all_processing_builds(platform: platform)
149
+ break if builds.count == 0
150
+ latest_build = builds.last
151
+
152
+ if latest_build.valid and must_update_build_info
153
+ # Set the changelog and/or description if necessary
154
+ if should_update_build_information(options)
155
+ latest_build.update_build_information!(whats_new: options[:changelog], description: options[:beta_app_description], feedback_email: options[:beta_app_feedback_email])
156
+ UI.success "Successfully set the changelog and/or description for build"
157
+ end
158
+ must_update_build_info = false
159
+ end
160
+
161
+ UI.message("Waiting for iTunes Connect to finish processing the new build (#{latest_build.train_version} - #{latest_build.build_version})")
162
+ end
163
+ end
164
+
165
+ UI.user_error!("Error receiving the newly uploaded binary, please check iTunes Connect") if latest_build.nil?
166
+ full_build = nil
167
+
168
+ while full_build.nil? || full_build.processing
169
+ # The build's processing state should go from true to false, and be done. But sometimes it goes true -> false ->
170
+ # true -> false, where the second true is transient. This causes a spurious failure. Find build by build_version
171
+ # and ensure it's not processing before proceeding - it had to have already been false before, to get out of the
172
+ # previous loop.
173
+ full_build = app.build_trains(platform: platform)[latest_build.train_version].builds.find do |b|
174
+ b.build_version == latest_build.build_version
175
+ end
176
+
177
+ UI.message("Waiting for iTunes Connect to finish processing the new build (#{latest_build.train_version} - #{latest_build.build_version})")
178
+ sleep(wait_processing_interval)
179
+ end
180
+
181
+ if full_build && !full_build.processing && full_build.valid
182
+ minutes = ((Time.now - start) / 60).round
183
+ UI.success("Successfully finished processing the build")
184
+ UI.message("You can now tweet: ")
185
+ UI.important("iTunes Connect #iosprocessingtime #{minutes} minutes")
186
+ return full_build
187
+ else
188
+ UI.user_error!("Error: Seems like iTunes Connect didn't properly pre-process the binary")
189
+ end
190
+ end
191
+
126
192
  def distribute_build(uploaded_build, options)
127
193
  UI.message("Distributing new build to testers")
128
194
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.18.1
4
+ version: 2.18.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2017-02-21 00:00:00.000000000 Z
17
+ date: 2017-02-22 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: slack-notifier
@@ -1023,7 +1023,6 @@ files:
1023
1023
  - fastlane_core/README.md
1024
1024
  - fastlane_core/lib/assets/XMLTemplate.xml.erb
1025
1025
  - fastlane_core/lib/fastlane_core.rb
1026
- - fastlane_core/lib/fastlane_core/build_watcher.rb
1027
1026
  - fastlane_core/lib/fastlane_core/cert_checker.rb
1028
1027
  - fastlane_core/lib/fastlane_core/command_executor.rb
1029
1028
  - fastlane_core/lib/fastlane_core/configuration/commander_generator.rb
@@ -1,80 +0,0 @@
1
- module FastlaneCore
2
- class BuildWatcher
3
- def self.find_build(app = nil)
4
- build = nil
5
- app.latest_version.candidate_builds.each do |b|
6
- if !build or b.upload_date > build.upload_date
7
- build = b
8
- end
9
- end
10
- unless build
11
- UI.user_error!("No processing builds available for app #{app.bundle_id}")
12
- end
13
- return build
14
- end
15
-
16
- def self.wait_for_train(app = nil, platform = "ios", sleep_time = 30)
17
- loop do
18
- sleep(sleep_time)
19
- if app.build_trains(platform: platform).count == 0
20
- UI.message("New application; waiting for build train to appear on iTunes Connect")
21
- else
22
- break
23
- end
24
- end
25
- end
26
-
27
- def self.wait_for_build(app = nil, platform = "ios", sleep_time = 0)
28
- start_time = Time.now
29
- UI.user_error!("Could not find app with app identifier #{app.bundle_id}") unless app
30
- # if this is a new version/app wait for train to show up.
31
- if app.build_trains(platform: platform).count == 0
32
- self.class.wait_for_train(app, platform, sleep_time)
33
- end
34
-
35
- latest_build = nil
36
- loop do
37
- if sleep_time > 0
38
- sleep(sleep_time)
39
- else
40
- return nil
41
- end
42
- builds = app.all_processing_builds(platform: platform)
43
- break if builds.count == 0
44
- latest_build = builds.last
45
- UI.message("Waiting for iTunes Connect to finish processing the new build (#{latest_build.train_version} - #{latest_build.build_version})")
46
- end
47
-
48
- UI.user_error!("Error receiving the newly uploaded binary, please check iTunes Connect") if latest_build.nil?
49
- full_build = nil
50
-
51
- while full_build.nil? || full_build.processing
52
- # The build's processing state should go from true to false, and be done. But sometimes it goes true -> false ->
53
- # true -> false, where the second true is transient. This causes a spurious failure. Find build by build_version
54
- # and ensure it's not processing before proceeding - it had to have already been false before, to get out of the
55
- # previous loop.
56
- full_build = app.build_trains(platform: platform)[latest_build.train_version].builds.find do |b|
57
- b.build_version == latest_build.build_version
58
- end
59
- if sleep_time > 0
60
- UI.message("Waiting for iTunes Connect to finish processing the new build (#{latest_build.train_version} - #{latest_build.build_version})")
61
- sleep(sleep_time)
62
- else
63
- return nil
64
- end
65
- end
66
-
67
- if full_build && !full_build.processing && full_build.valid
68
- minutes = ((Time.now - start_time) / 60).round
69
- UI.success("Successfully finished processing the build")
70
- UI.message("You can now tweet: ")
71
- UI.important("iTunes Connect #iosprocessingtime #{minutes} minutes")
72
- return full_build
73
- else
74
- UI.user_error!("Error: Seems like iTunes Connect didn't properly pre-process the binary")
75
- end
76
- end
77
-
78
- private_class_method :wait_for_train
79
- end
80
- end