pilot 1.3.0 → 1.4.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: f7149e94a5acfe24a53a3ccc3fcf6a1720f97019
4
- data.tar.gz: 6ada87b02c3f1c2d1ad15a5f13e661c8ea6f5601
3
+ metadata.gz: 083e9daa6e5b462f70042fd311183e9b59b7527b
4
+ data.tar.gz: 11162757ee19762349eb4a8be814739a80042dcb
5
5
  SHA512:
6
- metadata.gz: 3a1271238efca13d6919691f26bee1b5c37a637cad4fc3343a28ccb01fd4cc52b7106e413438734e5434f198a4b014aaacd80bc3f2a5363e6c5d963465e523a6
7
- data.tar.gz: 28b3a89a6a4f861b1b1186bfa56f9fbeada98de9768749bbe3fd5e52d35d0c18bf7c70c648980a2de32d45989a3841e4997fccc34c4c3ea1f3b520e1f7b8904e
6
+ metadata.gz: 9c4410c9652ac3870d0da149a9cf3399eed15cb8a8520b9592bb2a0ba6aa43d84c62fa5c7238a730d28197800e66729c994b14c5518be7ae08a7d301a9109811
7
+ data.tar.gz: 7fc21966e90776ca7e5570c742a20c03fb49f7bbe9bea6629c3a392d8c7bcb16db3c7102a63f84a7c8228b93db9fdc03321d06fb2639629af6995b662cce523c
@@ -5,7 +5,6 @@ require "pilot/build_manager"
5
5
  require "pilot/tester_manager"
6
6
  require "pilot/tester_importer"
7
7
  require "pilot/tester_exporter"
8
- require "pilot/package_builder"
9
8
 
10
9
  require "fastlane_core"
11
10
  require "spaceship"
@@ -7,9 +7,11 @@ module Pilot
7
7
 
8
8
  Helper.log.info "Ready to upload new build to TestFlight (App: #{app.apple_id})...".green
9
9
 
10
- package_path = PackageBuilder.new.generate(apple_id: app.apple_id,
11
- ipa_path: config[:ipa],
12
- package_path: "/tmp")
10
+ plist = FastlaneCore::IpaFileAnalyser.fetch_info_plist_file(config[:ipa]) || {}
11
+ package_path = FastlaneCore::IpaUploadPackageBuilder.new.generate(app_id: app.apple_id,
12
+ ipa_path: config[:ipa],
13
+ package_path: "/tmp",
14
+ platform: plist["DTPlatformName"])
13
15
 
14
16
  transporter = FastlaneCore::ItunesTransporter.new(options[:username])
15
17
  result = transporter.upload(app.apple_id, package_path)
@@ -105,9 +107,19 @@ module Pilot
105
107
  # First, set the changelog (if necessary)
106
108
  uploaded_build.update_build_information!(whats_new: options[:changelog])
107
109
 
108
- # Submit for internal beta testing
110
+ # Submit for review before external testflight is available
111
+ if options[:distribute_external]
112
+ uploaded_build.client.submit_testflight_build_for_review!(
113
+ app_id: uploaded_build.build_train.application.apple_id,
114
+ train: uploaded_build.build_train.version_string,
115
+ build_number: uploaded_build.build_version,
116
+ platform: uploaded_build.platform
117
+ )
118
+ end
119
+
120
+ # Submit for beta testing
109
121
  type = options[:distribute_external] ? 'external' : 'internal'
110
- uploaded_build.build_train.update_testing_status!(true, type)
122
+ uploaded_build.build_train.update_testing_status!(true, type, uploaded_build)
111
123
  return true
112
124
  end
113
125
  end
@@ -1,5 +1,4 @@
1
1
  # rubocop:disable Metrics/MethodLength
2
- # rubocop:disable Metrics/AbcSize
3
2
  require "commander"
4
3
  require "pilot/options"
5
4
  require "fastlane_core"
@@ -25,9 +24,21 @@ module Pilot
25
24
  o
26
25
  end
27
26
 
28
- def handle_email(config, args)
29
- config[:email] ||= args.first
30
- config[:email] ||= ask("Email address of the tester: ".yellow)
27
+ def handle_multiple(action, args, options)
28
+ mgr = Pilot::TesterManager.new
29
+ config = FastlaneCore::Configuration.create(Pilot::Options.available_options, convert_options(options))
30
+ args.push(ask("Email address of the tester: ".yellow)) if args.empty?
31
+ failures = []
32
+ args.each do |address|
33
+ config[:email] = address
34
+ begin
35
+ mgr.public_send(action, config)
36
+ rescue => ex
37
+ failures.push(address)
38
+ Helper.log.info "[#{address}]: #{ex}".red
39
+ end
40
+ end
41
+ raise "Some operations failed: #{failures}".red unless failures.empty?
31
42
  end
32
43
 
33
44
  def run
@@ -60,11 +71,9 @@ module Pilot
60
71
 
61
72
  command :add do |c|
62
73
  c.syntax = "pilot add"
63
- c.description = "Adds a new external tester to a specific app (if given). This will also add an existing tester to an app."
74
+ c.description = "Adds new external tester(s) to a specific app (if given). This will also add an existing tester to an app."
64
75
  c.action do |args, options|
65
- config = FastlaneCore::Configuration.create(Pilot::Options.available_options, convert_options(options))
66
- handle_email(config, args)
67
- Pilot::TesterManager.new.add_tester(config)
76
+ handle_multiple('add_tester', args, options)
68
77
  end
69
78
  end
70
79
 
@@ -79,21 +88,17 @@ module Pilot
79
88
 
80
89
  command :find do |c|
81
90
  c.syntax = "pilot find"
82
- c.description = "Find a tester (internal or external) by their email address"
91
+ c.description = "Find tester(s) (internal or external) by their email address"
83
92
  c.action do |args, options|
84
- config = FastlaneCore::Configuration.create(Pilot::Options.available_options, convert_options(options))
85
- handle_email(config, args)
86
- Pilot::TesterManager.new.find_tester(config)
93
+ handle_multiple('find_tester', args, options)
87
94
  end
88
95
  end
89
96
 
90
97
  command :remove do |c|
91
98
  c.syntax = "pilot remove"
92
- c.description = "Remove an external tester by their email address"
99
+ c.description = "Remove external tester(s) by their email address"
93
100
  c.action do |args, options|
94
- config = FastlaneCore::Configuration.create(Pilot::Options.available_options, convert_options(options))
95
- handle_email(config, args)
96
- Pilot::TesterManager.new.remove_tester(config)
101
+ handle_multiple('remove_tester', args, options)
97
102
  end
98
103
  end
99
104
 
@@ -80,7 +80,7 @@ module Pilot
80
80
  env_name: "PILOT_WAIT_PROCESSING_INTERVAL",
81
81
  description: "Interval in seconds to wait for iTunes Connect processing",
82
82
  default_value: 30,
83
- is_string: false,
83
+ type: Integer,
84
84
  verify_block: proc do |value|
85
85
  raise "Please enter a valid positive number of seconds" unless value.to_i > 0
86
86
  end),
@@ -87,12 +87,12 @@ module Pilot
87
87
  def list(all_testers, title)
88
88
  rows = []
89
89
  all_testers.each do |tester|
90
- rows << [tester.first_name, tester.last_name, tester.email, tester.devices.count]
90
+ rows << [tester.first_name, tester.last_name, tester.email, tester.devices.count, tester.full_version, tester.pretty_install_date]
91
91
  end
92
92
 
93
93
  puts Terminal::Table.new(
94
94
  title: title.green,
95
- headings: ["First", "Last", "Email", "Devices"],
95
+ headings: ["First", "Last", "Email", "Devices", "Latest Version", "Latest Install Date"],
96
96
  rows: rows
97
97
  )
98
98
  end
@@ -1,4 +1,4 @@
1
1
  module Pilot
2
- VERSION = "1.3.0"
2
+ VERSION = "1.4.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.3.0
4
+ version: 1.4.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-02-05 00:00:00.000000000 Z
11
+ date: 2016-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fastlane_core
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.31.0
19
+ version: 0.36.5
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: 1.0.0
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 0.31.0
29
+ version: 0.36.5
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 1.0.0
@@ -36,7 +36,7 @@ dependencies:
36
36
  requirements:
37
37
  - - ">="
38
38
  - !ruby/object:Gem::Version
39
- version: 0.16.0
39
+ version: 0.20.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.16.0
49
+ version: 0.20.0
50
50
  - - "<"
51
51
  - !ruby/object:Gem::Version
52
52
  version: 1.0.0
@@ -215,13 +215,11 @@ files:
215
215
  - LICENSE
216
216
  - README.md
217
217
  - bin/pilot
218
- - lib/assets/XMLTemplate.xml.erb
219
218
  - lib/pilot.rb
220
219
  - lib/pilot/build_manager.rb
221
220
  - lib/pilot/commands_generator.rb
222
221
  - lib/pilot/manager.rb
223
222
  - lib/pilot/options.rb
224
- - lib/pilot/package_builder.rb
225
223
  - lib/pilot/tester_exporter.rb
226
224
  - lib/pilot/tester_importer.rb
227
225
  - lib/pilot/tester_manager.rb
@@ -1,12 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <package xmlns="http://apple.com/itunes/importer" version="software4.7">
3
- <software_assets apple_id="<%= @data[:apple_id] %>">
4
- <asset type="bundle">
5
- <data_file>
6
- <size><%= @data[:file_size] %></size>
7
- <file_name><%= @data[:ipa_path] %></file_name>
8
- <checksum type="md5"><%= @data[:md5] %></checksum>
9
- </data_file>
10
- </asset>
11
- </software_assets>
12
- </package>
@@ -1,43 +0,0 @@
1
- require "digest/md5"
2
-
3
- module Pilot
4
- class PackageBuilder
5
- METADATA_FILE_NAME = "metadata.xml"
6
-
7
- attr_accessor :package_path
8
-
9
- def generate(apple_id: nil, ipa_path: nil, package_path: nil)
10
- self.package_path = File.join(package_path, "#{apple_id}.itmsp")
11
- FileUtils.rm_rf self.package_path if File.directory?(self.package_path)
12
- FileUtils.mkdir_p self.package_path
13
-
14
- lib_path = Helper.gem_path("pilot")
15
-
16
- ipa_path = copy_ipa(ipa_path)
17
- @data = {
18
- apple_id: apple_id,
19
- file_size: File.size(ipa_path),
20
- ipa_path: File.basename(ipa_path), # this is only the base name as the ipa is inside the package
21
- md5: Digest::MD5.hexdigest(File.read(ipa_path))
22
- }
23
-
24
- xml_path = File.join(lib_path, "lib/assets/XMLTemplate.xml.erb")
25
- xml = ERB.new(File.read(xml_path)).result(binding) # http://www.rrn.dk/rubys-erb-templating-system
26
-
27
- File.write(File.join(self.package_path, METADATA_FILE_NAME), xml)
28
- Helper.log.info "Wrote XML data to '#{self.package_path}'".green if $verbose
29
-
30
- return package_path
31
- end
32
-
33
- private
34
-
35
- def copy_ipa(ipa_path)
36
- ipa_file_name = Digest::MD5.hexdigest(ipa_path)
37
- resulting_path = File.join(self.package_path, "#{ipa_file_name}.ipa")
38
- FileUtils.cp(ipa_path, resulting_path)
39
-
40
- return resulting_path
41
- end
42
- end
43
- end