pilot 1.9.2 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e2498dbfe21a7cac7faa3097301156220f8391c6
4
- data.tar.gz: 6f374086fa54bc6a88312a7c00da04cc7dc4b1a5
3
+ metadata.gz: 193709deab5ca85cba1eec5d0f6c32adc3d3a899
4
+ data.tar.gz: dc5688ea2356540eabe2c297b828fd645a7e6079
5
5
  SHA512:
6
- metadata.gz: dc581d9f88b3f68fcdb6490686d841f734f5d85772ba2435da4de40fd71878aada0af0623c3850feb72fdfe24492802a98bf19bef559cffe614e62779fd0793e
7
- data.tar.gz: 7d408d04c80b3c35511f49afd4c27947ee5b21bf78817c5a629bc61353afd4a37bfee9877ef024c963ff9ab691b6576e55f7732c4e49eabf007d17ab61f68e63
6
+ metadata.gz: 4f118118001033f5962498f3d0379f942c1907a8c4ec94ef9c079e283b9eee90692f027f8e220bf34390b1a64f6bb5d7f62ac99136f26c784374a87d9bb7a80e
7
+ data.tar.gz: 3f4999fb02b090d4283df340411f608de3bf4aabb63ca7561c999229104dac2fecd05f18575d6fcb17d31477e9c3b0b29f84ff5212caf425194eaef3ec862dc3
data/README.md CHANGED
@@ -35,13 +35,12 @@ Pilot
35
35
 
36
36
  ###### The best way to manage your TestFlight testers and builds from your terminal
37
37
 
38
- This tool allows you to manage all important features of Apple TestFlight using your terminal.
38
+ Pilot makes it easier to manage your app on Apple’s TestFlight. You can:
39
39
 
40
- - Upload new builds and distribute them to all testers
41
- - List all available builds
42
- - Add and remove beta testers
43
- - Get information about testers, like the registered devices
44
- - Export and import all your testers
40
+ - Upload & distribute builds
41
+ - Add & remove testers
42
+ - Retrieve information about testers & devices
43
+ - Import/export all available testers
45
44
 
46
45
  Get in contact with the developer on Twitter: [@FastlaneTools](https://twitter.com/FastlaneTools)
47
46
 
@@ -158,7 +157,7 @@ The output will look like this:
158
157
 
159
158
  ### Add a new tester
160
159
 
161
- To add a new tester to both your iTunes Connect account and to your app (if given), use the `pilot add` command. This will create a new tester (if necesssary) or add an existing tester to the app to test.
160
+ To add a new tester to both your iTunes Connect account and to your app (if given), use the `pilot add` command. This will create a new tester (if necessary) or add an existing tester to the app to test.
162
161
 
163
162
  ```
164
163
  pilot add email@invite.com
@@ -1,5 +1,9 @@
1
+ # fastlane_core must be required before 'pilot/features' which depends on it for FastlaneCore::Feature
2
+ require "fastlane_core"
3
+
1
4
  require "json"
2
5
  require "pilot/version"
6
+ require 'pilot/features'
3
7
  require "pilot/options"
4
8
  require "pilot/manager"
5
9
  require "pilot/build_manager"
@@ -7,7 +11,6 @@ require "pilot/tester_manager"
7
11
  require "pilot/tester_importer"
8
12
  require "pilot/tester_exporter"
9
13
 
10
- require "fastlane_core"
11
14
  require "spaceship"
12
15
  require "terminal-table"
13
16
 
@@ -33,14 +33,44 @@ module Pilot
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
34
  uploaded_build = wait_for_processing_build # this might take a while
35
35
 
36
+ distribute(options, uploaded_build)
37
+ end
38
+
39
+ def distribute(options, build = nil)
40
+ start(options)
41
+ if config[:apple_id].to_s.length == 0 and config[:app_identifier].to_s.length == 0
42
+ config[:app_identifier] = ask("App Identifier: ")
43
+ end
44
+
45
+ if build.nil?
46
+ builds = app.all_processing_builds + app.builds
47
+ # sort by upload_date
48
+ builds.sort! { |a, b| a.upload_date <=> b.upload_date }
49
+ build = builds.last
50
+ if build.nil?
51
+ UI.user_error!("No builds found.")
52
+ return
53
+ end
54
+ if build.processing
55
+ UI.user_error!("Build #{build.train_version}(#{build.build_version}) is still processing.")
56
+ return
57
+ end
58
+ if build.testing_status == "External"
59
+ UI.user_error!("Build #{build.train_version}(#{build.build_version}) has already been distributed.")
60
+ return
61
+ end
62
+
63
+ UI.message("Distributing build #{build.train_version}(#{build.build_version}) from #{build.testing_status} -> External")
64
+ end
65
+
36
66
  # First, set the changelog (if necessary)
37
67
  if options[:changelog].to_s.length > 0
38
- uploaded_build.update_build_information!(whats_new: options[:changelog])
68
+ build.update_build_information!(whats_new: options[:changelog])
39
69
  UI.success "Successfully set the changelog for build"
40
70
  end
41
71
 
42
72
  return if config[:skip_submission]
43
- distribute_build(uploaded_build, options)
73
+ distribute_build(build, options)
44
74
  UI.message("Successfully distributed build to beta testers 🚀")
45
75
  end
46
76
 
@@ -52,7 +82,7 @@ module Pilot
52
82
 
53
83
  builds = app.all_processing_builds + app.builds
54
84
  # sort by upload_date
55
- builds.sort! {|a, b| a.upload_date <=> b.upload_date }
85
+ builds.sort! { |a, b| a.upload_date <=> b.upload_date }
56
86
  rows = builds.collect { |build| describe_build(build) }
57
87
 
58
88
  puts Terminal::Table.new(
@@ -79,17 +109,26 @@ module Pilot
79
109
  def wait_for_processing_build
80
110
  # the upload date of the new buid
81
111
  # we use it to identify the build
82
-
83
112
  start = Time.now
84
113
  wait_processing_interval = config[:wait_processing_interval].to_i
85
114
  latest_build = nil
86
115
  UI.message("Waiting for iTunes Connect to process the new build")
87
116
  loop do
88
117
  sleep wait_processing_interval
89
- builds = app.all_processing_builds
90
- break if builds.count == 0
91
- latest_build = builds.last
92
- UI.message("Waiting for iTunes Connect to finish processing the new build (#{latest_build.train_version} - #{latest_build.build_version})")
118
+
119
+ # before we look for processing builds, we need to ensure that there
120
+ # is a build train for this application; new applications don't
121
+ # build trains right away, and if we don't do this check, we will
122
+ # get break out of this loop and then generate an error later when we
123
+ # have a nil build
124
+ if FastlaneCore::Feature.enabled?('PILOT_WAIT_FOR_NEW_BUILD_TRAINS_ON_ITUNES_CONNECT') && app.build_trains.count == 0
125
+ UI.message("New application; waiting for build train to appear on iTunes Connect")
126
+ else
127
+ builds = app.all_processing_builds
128
+ break if builds.count == 0
129
+ latest_build = builds.last
130
+ UI.message("Waiting for iTunes Connect to finish processing the new build (#{latest_build.train_version} - #{latest_build.build_version})")
131
+ end
93
132
  end
94
133
 
95
134
  UI.user_error!("Error receiving the newly uploaded binary, please check iTunes Connect") if latest_build.nil?
@@ -1,4 +1,5 @@
1
1
  # rubocop:disable Metrics/MethodLength
2
+ # rubocop:disable Metrics/AbcSize
2
3
  require "commander"
3
4
  require "pilot/options"
4
5
  require "fastlane_core"
@@ -61,6 +62,16 @@ module Pilot
61
62
  end
62
63
  end
63
64
 
65
+ command :distribute do |c|
66
+ c.syntax = "pilot distribute"
67
+ c.description = "Distribute a previously uploaded binary to Apple TestFlight"
68
+ c.action do |args, options|
69
+ config = FastlaneCore::Configuration.create(Pilot::Options.available_options, convert_options(options))
70
+ config[:distribute_external] = true
71
+ Pilot::BuildManager.new.distribute(config)
72
+ end
73
+ end
74
+
64
75
  command :builds do |c|
65
76
  c.syntax = "pilot builds"
66
77
  c.description = "Lists all builds for given application"
@@ -0,0 +1,2 @@
1
+ FastlaneCore::Feature.register(env_var: 'PILOT_WAIT_FOR_NEW_BUILD_TRAINS_ON_ITUNES_CONNECT',
2
+ description: 'When submitting a build, wait for the build train to appear on iTunes Connect if not present yet (will be default eventually)')
@@ -103,8 +103,16 @@ module Pilot
103
103
  end
104
104
 
105
105
  def list_testers_global
106
- int_testers = Spaceship::Tunes::Tester::Internal.all
107
- ext_testers = Spaceship::Tunes::Tester::External.all
106
+ begin
107
+ int_testers = Spaceship::Tunes::Tester::Internal.all
108
+ ext_testers = Spaceship::Tunes::Tester::External.all
109
+ rescue => ex
110
+ if ex.to_s.include?("Forbidden")
111
+ UI.user_error!("You don't have the permission to list the testers of your whole team. Please provide an app identifier to list all testers of a specific application.")
112
+ else
113
+ raise ex
114
+ end
115
+ end
108
116
 
109
117
  list_global(int_testers, "Internal Testers")
110
118
  puts ""
@@ -1,4 +1,4 @@
1
1
  module Pilot
2
- VERSION = "1.9.2"
2
+ VERSION = "1.10.0"
3
3
  DESCRIPTION = "The best way to manage your TestFlight testers and builds from your terminal"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pilot
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.2
4
+ version: 1.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-02 00:00:00.000000000 Z
11
+ date: 2016-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fastlane_core
@@ -36,7 +36,7 @@ dependencies:
36
36
  requirements:
37
37
  - - ">="
38
38
  - !ruby/object:Gem::Version
39
- version: 0.27.0
39
+ version: 0.29.0
40
40
  - - "<"
41
41
  - !ruby/object:Gem::Version
42
42
  version: 1.0.0
@@ -46,7 +46,7 @@ dependencies:
46
46
  requirements:
47
47
  - - ">="
48
48
  - !ruby/object:Gem::Version
49
- version: 0.27.0
49
+ version: 0.29.0
50
50
  - - "<"
51
51
  - !ruby/object:Gem::Version
52
52
  version: 1.0.0
@@ -232,6 +232,7 @@ files:
232
232
  - lib/pilot.rb
233
233
  - lib/pilot/build_manager.rb
234
234
  - lib/pilot/commands_generator.rb
235
+ - lib/pilot/features.rb
235
236
  - lib/pilot/manager.rb
236
237
  - lib/pilot/options.rb
237
238
  - lib/pilot/tester_exporter.rb
@@ -259,7 +260,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
259
260
  version: '0'
260
261
  requirements: []
261
262
  rubyforge_project:
262
- rubygems_version: 2.4.0
263
+ rubygems_version: 2.2.2
263
264
  signing_key:
264
265
  specification_version: 4
265
266
  summary: The best way to manage your TestFlight testers and builds from your terminal