TestFlightExporter 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +18 -2
- data/bin/tfexporter +6 -5
- data/lib/testflight_exporter.rb +28 -11
- data/lib/testflight_exporter/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63e970e8a2b5334d2df6bcdc542ab38b8214075b
|
4
|
+
data.tar.gz: 48da93bec74cd46805875559ea924cfb372d303f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0cee61c44ba82a4eab587422c267b0ace78542f0ff823d65a3af7637d2cd0219ccaf72519ccfeedfa1a9037d5c3eef6ecacdaf4abc259d62e05120d9f633dd03
|
7
|
+
data.tar.gz: 9049c4ede595d6d12f8bb2a1adfc9278ea024adddf29888925a8fd700dc9db126d015b203ef79447fc5d0f42c2c4f02eb60c33f9242201e64887c35d4bdc629f
|
data/README.md
CHANGED
@@ -25,7 +25,23 @@ Follow the setup assistent, which will configure the current TestFlight Exporter
|
|
25
25
|
Like all the CLI tool TestFlight Exporter comes with global options that you can use to fire the tool and take a break for a good coffee :coffee: .
|
26
26
|
Launch TestFlight exporter with `--help` option to have a quick overview about all of them.
|
27
27
|
|
28
|
-
**Warning**: Depending on the number of builds you have in your TestFlight account, TestFlight Exporter could consume a lot of data/bandwidth.
|
28
|
+
**Warning**: Depending on the number of builds you have in your TestFlight account, TestFlight Exporter could consume a lot of data/bandwidth. Use
|
29
|
+
|
30
|
+
$ tfexplorer --max [MAX_NUMBER]
|
31
|
+
|
32
|
+
to limit number of downloaded binaries per build.
|
33
|
+
|
34
|
+
### HockeyApp integration
|
35
|
+
|
36
|
+
Since version 0.2.0 TestFlight exporter supports the upload of your downloaded binaries on HockeyApp platform.
|
37
|
+
Execute the following command in your terminal:
|
38
|
+
|
39
|
+
$ tfexporter hockeyapp --token [YOUR_API_TOKEN] --input [YOUR_BINARIES_PATH]
|
40
|
+
|
41
|
+
|
42
|
+
To get a list of available options, execute:
|
43
|
+
|
44
|
+
$ tfexporter hockeyapp --help
|
29
45
|
|
30
46
|
## How does this thing work?
|
31
47
|
|
@@ -62,4 +78,4 @@ Follow us on twitter @touchwonders and let me know what you think!
|
|
62
78
|
|
63
79
|
## License
|
64
80
|
|
65
|
-
TestFlight exporter is available under the MIT license. See the LICENSE file for more info.
|
81
|
+
TestFlight exporter is available under the MIT license. See the LICENSE file for more info.
|
data/bin/tfexporter
CHANGED
@@ -28,15 +28,16 @@ class TestFlightExporterApplication
|
|
28
28
|
command :dump do |c|
|
29
29
|
c.syntax = 'tfexporter migrate'
|
30
30
|
c.description = 'Download your binaries from TestFlightapp.com'
|
31
|
-
c.option '--username
|
32
|
-
c.option '--password
|
33
|
-
c.option '--output
|
34
|
-
c.option '--team
|
31
|
+
c.option '--username STRING', String, 'Your testflight account username'
|
32
|
+
c.option '--password STRING', String, 'Your testflight account password'
|
33
|
+
c.option '--output FOLDER', String, 'Path to your output folder where your binaries will be downloaded'
|
34
|
+
c.option '--team TEAM', String, 'TestFlight team name to process'
|
35
|
+
c.option '--max MAX', Integer, 'Max number of binaries per build to download (from latest binary to the oldest).'
|
35
36
|
|
36
37
|
c.action do |args, options|
|
37
38
|
ENV['VERBOSE_MODE'] = 'true' if options.verbose
|
38
39
|
|
39
|
-
TestFlightExporter::Setup.new.setup(options
|
40
|
+
TestFlightExporter::Setup.new.setup(options)
|
40
41
|
end
|
41
42
|
end
|
42
43
|
|
data/lib/testflight_exporter.rb
CHANGED
@@ -13,13 +13,15 @@ module TestFlightExporter
|
|
13
13
|
def initialize
|
14
14
|
@agent = Mechanize.new
|
15
15
|
@team_list = Hash.new
|
16
|
+
@downloaded_binaries = 0
|
16
17
|
end
|
17
18
|
|
18
|
-
def setup (
|
19
|
-
@username = username
|
20
|
-
@password = password
|
21
|
-
@team = team
|
22
|
-
@path = output_folder
|
19
|
+
def setup (options)
|
20
|
+
@username = options.username
|
21
|
+
@password = options.password
|
22
|
+
@team = options.team
|
23
|
+
@path = options.output_folder
|
24
|
+
@max = options.max
|
23
25
|
@username = ask("Enter your TestFlight username: ") { |q| q.echo = true } if @username.nil?
|
24
26
|
@password = ask("Enter your TestFlight password: ") { |q| q.echo = "*" } if @password.nil?
|
25
27
|
@path = ask("Enter your output folder where all the IPAs will be downloaded: "){ |q| q.echo = true } if @path.nil?
|
@@ -28,7 +30,6 @@ module TestFlightExporter
|
|
28
30
|
if File.directory?(@path)
|
29
31
|
# The in input path already exist we prefer to fail instead of using overriding policies
|
30
32
|
Helper.exit_with_error "\"#{@path}\" is an existing directory. Please specify another output folder".red
|
31
|
-
return
|
32
33
|
end
|
33
34
|
|
34
35
|
# Initialize Test Flight login page
|
@@ -73,7 +74,7 @@ module TestFlightExporter
|
|
73
74
|
|
74
75
|
unless @team.nil?
|
75
76
|
process_teams false, @team
|
76
|
-
|
77
|
+
exit_by_print_success_builds_no
|
77
78
|
end
|
78
79
|
|
79
80
|
if (@team_list.count > 1)
|
@@ -125,11 +126,10 @@ module TestFlightExporter
|
|
125
126
|
Helper.log.info "Processing team: #{@current_team}".blue
|
126
127
|
|
127
128
|
process_dashboard_page @dashboard_page
|
128
|
-
|
129
|
+
exit_by_print_success_builds_no
|
129
130
|
else
|
130
131
|
if @team_list["#{team_name}"].nil?
|
131
132
|
Helper.exit_with_error "Sorry, I can\'t find #{team_name} in your teams.".red
|
132
|
-
return
|
133
133
|
end
|
134
134
|
|
135
135
|
switch_to_team_id @team_list["#{team_name}"], team_name
|
@@ -137,7 +137,7 @@ module TestFlightExporter
|
|
137
137
|
# process current team
|
138
138
|
|
139
139
|
process_dashboard_page @agent.get("https://testflightapp.com/dashboard/applications/")
|
140
|
-
|
140
|
+
exit_by_print_success_builds_no
|
141
141
|
end
|
142
142
|
end
|
143
143
|
end
|
@@ -165,6 +165,7 @@ module TestFlightExporter
|
|
165
165
|
link.href =~ app_link_pattern
|
166
166
|
if $1 != nil
|
167
167
|
Helper.log.debug "Builds page for #{$1}...".magenta
|
168
|
+
@build_downloaded_binaries = 0
|
168
169
|
|
169
170
|
@agent.get "https://testflightapp.com/dashboard/applications/#{$1}/builds/" do |builds_page|
|
170
171
|
|
@@ -189,6 +190,7 @@ module TestFlightExporter
|
|
189
190
|
# Cycle over remaning build pages
|
190
191
|
i = 2
|
191
192
|
inner_pages.each do |page|
|
193
|
+
break if (!@max.nil? && @build_downloaded_binaries == @max)
|
192
194
|
Helper.log.debug "Page #{i} of #{number_of_pages}".magenta
|
193
195
|
|
194
196
|
process_builds_page @agent.get "https://testflightapp.com#{page}"
|
@@ -214,6 +216,10 @@ module TestFlightExporter
|
|
214
216
|
build_pages = body.scan /<tr class="goversion pointer" id="\/dashboard\/builds\/report\/(.*?)\/">/
|
215
217
|
|
216
218
|
build_pages.each do |build_id|
|
219
|
+
unless @max.nil?
|
220
|
+
break if @build_downloaded_binaries == @max
|
221
|
+
end
|
222
|
+
|
217
223
|
@agent.get "https://testflightapp.com/dashboard/builds/complete/#{build_id.first}/" do |build_page|
|
218
224
|
# Retrieve current app name
|
219
225
|
@current_app_name = page.at("h2").text
|
@@ -272,7 +278,18 @@ module TestFlightExporter
|
|
272
278
|
FileUtils.mkdir_p(dirname) unless File.directory?(dirname)
|
273
279
|
|
274
280
|
@agent.get(file_url).save("#{@path}/#{@current_team}/#{@current_bundle_identifier} builds/#{filename}")
|
275
|
-
|
281
|
+
|
282
|
+
if File.file?("#{@path}/#{@current_team}/#{@current_bundle_identifier} builds/#{filename}")
|
283
|
+
@downloaded_binaries = @downloaded_binaries + 1
|
284
|
+
@build_downloaded_binaries = @build_downloaded_binaries + 1
|
285
|
+
File.open("#{@path}/#{@current_team}/#{@current_bundle_identifier} builds/#{$1}.txt", 'w') {|f| f.write(release_note) } unless release_note.nil?
|
286
|
+
end
|
287
|
+
end
|
288
|
+
|
289
|
+
def exit_by_print_success_builds_no
|
290
|
+
Helper.log.info "#{@downloaded_binaries} binaries have been successfully downloaded! ".green unless @downloaded_binaries==0
|
291
|
+
Helper.log.info "Thanks for using our tool. Hoped you liked it. Please don't forget to share it ;)".cyan
|
292
|
+
exit
|
276
293
|
end
|
277
294
|
end
|
278
295
|
end
|