shenzhen 0.13.2 → 0.14.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: ad3b3dc21f993a72976f88a09557910c72af4bb1
4
- data.tar.gz: 84c9625fb055f55da14a93f4fd0d3d1271dd464b
3
+ metadata.gz: 4fb54f48748da28b11064014eb594646d3e09c1a
4
+ data.tar.gz: b5f1fdd3849095b29285d766fa1aca0bc9ca7471
5
5
  SHA512:
6
- metadata.gz: dbced5f036292d83357491a7167848c30a636f54153e562eb120a7c59e05abf8729db83099b9013cb3c8d78ea9eb07f5dd0de1ab620fabfd20a1591b8b4efb9b
7
- data.tar.gz: 78dc4bcb34e4c231ff236f2ac2ea3e1040cf7d5ae0c4d01291f82a7cf99ec4f47d4943ad36894faccb5a1fc9ca8ed05b18c7cdaee67b6e1764ea965ed7857d34
6
+ metadata.gz: 25175719aa35e00ffab3de7ef8c7c84b357628535d1d8832b7cc703d18faff2a1591b3aabf7e21c194ed32af16ba9fc28e2eb6d362226dc4122abff5da01d5c1
7
+ data.tar.gz: b8dcd3af4cd8cbb2220fadc731a6dc893426686c98ceca1502646f12534f1b2eebddf20def526ce3f9c1dfd4a114a23e66c649352c71ffa3b30a0d6cb62d1d1a
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shenzhen (0.13.2)
4
+ shenzhen (0.14.0)
5
5
  aws-sdk (~> 1.0)
6
6
  commander (~> 4.3)
7
7
  dotenv (~> 0.7)
data/README.md CHANGED
@@ -4,7 +4,9 @@ Create `.ipa` files and distribute them from the command line, using any of the
4
4
 
5
5
  - [iTunes Connect](https://itunesconnect.apple.com)
6
6
  - [HockeyApp](http://www.hockeyapp.net)
7
- - [Crashlytics Beta](http://try.crashlytics.com/beta/)
7
+ - [Beta by Crashlytics](http://try.crashlytics.com/beta/)
8
+ - [RivieraBuild](http://rivierabuild.com)
9
+ - [TestFairy](https://www.testfairy.com/)
8
10
  - [DeployGate](https://deploygate.com)
9
11
  - [Fly It Remotely (FIR.im)](http://fir.im)
10
12
  - [蒲公英 (PGYER)](http://www.pgyer.com)
@@ -47,6 +49,7 @@ Build and distribute iOS apps (.ipa files)
47
49
 
48
50
  Commands:
49
51
  build Create a new .ipa file for your app
52
+ distribute:rivierabuild Distribute an .ipa file over [RivieraBuild](http://rivierabuild.com)
50
53
  distribute:hockeyapp Distribute an .ipa file over HockeyApp
51
54
  distribute:crashlytics Distribute an .ipa file over Crashlytics
52
55
  distribute:deploygate Distribute an .ipa file over deploygate
@@ -55,6 +58,7 @@ Build and distribute iOS apps (.ipa files)
55
58
  distribute:pgyer Distribute an .ipa file over Pgyer
56
59
  distribute:ftp Distribute an .ipa file over FTP
57
60
  distribute:s3 Distribute an .ipa file over Amazon S3
61
+ distribute:testfairy Distribute an .ipa file over TestFairy
58
62
  info Show mobile provisioning information about an .ipa file
59
63
  help Display global or [command] help documentation.
60
64
 
@@ -72,6 +76,15 @@ $ ipa build
72
76
  $ ipa distribute
73
77
  ```
74
78
 
79
+ #### RivieraBuild Distribution
80
+
81
+ ```
82
+ $ ipa distribute:rivierabuild -k API_TOKEN -a AVAILABILITY
83
+ ```
84
+
85
+ > Shenzhen will load credentials from the environment variable `RIVIERA_API_TOKEN` unless otherwise specified.
86
+ > To get the list of availability options, visit http://api.rivierabuild.com
87
+
75
88
  #### HockeyApp Distribution
76
89
 
77
90
  ```
@@ -80,6 +93,14 @@ $ ipa distribute:hockeyapp -a API_TOKEN
80
93
 
81
94
  > Shenzhen will load credentials from the environment variable `HOCKEYAPP_API_TOKEN` unless otherwise specified.
82
95
 
96
+ #### TestFairy Distribution
97
+
98
+ ```
99
+ $ ipa distribute:testfairy -a API_KEY
100
+ ```
101
+
102
+ > Shenzhen will load credentials from the environment variable `TESTFAIRY_API_KEY` unless otherwise specified.
103
+
83
104
  #### Crashlytics Beta Distribution
84
105
 
85
106
  ```
@@ -174,4 +195,4 @@ Mattt Thompson ([@mattt](https://twitter.com/mattt))
174
195
 
175
196
  ## License
176
197
 
177
- Shenzhen is available under the MIT license. See the LICENSE file for more info.
198
+ Shenzhen is released under an MIT license. See LICENSE for more information.
@@ -1,6 +1,8 @@
1
1
  $:.push File.expand_path('../', __FILE__)
2
2
 
3
+ require 'plugins/rivierabuild'
3
4
  require 'plugins/hockeyapp'
5
+ require 'plugins/testfairy'
4
6
  require 'plugins/deploygate'
5
7
  require 'plugins/itunesconnect'
6
8
  require 'plugins/ftp'
@@ -122,7 +122,7 @@ command :build do |c|
122
122
  end
123
123
 
124
124
  log "zip", @dsym_filename
125
- abort unless system %{cp -r "#{@dsym_path}" "#{@destination}" && zip -r "#{@dsym_filename}.zip" "#{@dsym_filename}" #{'> /dev/null' unless $verbose} && rm -rf "#{@dsym_filename}"}
125
+ abort unless system %{cp -r "#{@dsym_path}" "#{@destination}" && pushd "#{File.dirname(@dsym_filename)}" && zip -r "#{@dsym_filename}.zip" "#{File.basename(@dsym_filename)}" #{'> /dev/null' unless $verbose} && popd && rm -rf "#{@dsym_filename}"}
126
126
 
127
127
  say_ok "Successfully built:"
128
128
  say_ok @ipa_path
@@ -30,10 +30,9 @@ module Shenzhen::Plugins
30
30
 
31
31
  File.write("Package.itmsp/metadata.xml", metadata(@apple_id, checksum, size))
32
32
 
33
- case transport
34
- when /(error)|(fail)/i
35
- say_error "An error occurred when trying to upload the build to iTunesConnect.\nRun with --verbose for more info." and abort
36
- end
33
+ raise if /(error)|(fail)/i === transport
34
+ rescue
35
+ say_error "An error occurred when trying to upload the build to iTunesConnect.\nRun with --verbose for more info." and abort
37
36
  ensure
38
37
  FileUtils.rm_rf("Package.itmsp", :secure => true)
39
38
  end
@@ -44,6 +43,7 @@ module Shenzhen::Plugins
44
43
  def transport
45
44
  xcode = `xcode-select --print-path`.strip
46
45
  tool = File.join(File.dirname(xcode), "Applications/Application Loader.app/Contents/MacOS/itms/bin/iTMSTransporter").gsub(/\s/, '\ ')
46
+ tool = File.join(File.dirname(xcode), "Applications/Application Loader.app/Contents/itms/bin/iTMSTransporter").gsub(/\s/, '\ ') if !File.exist?(tool)
47
47
 
48
48
  args = [tool, "-m upload", "-f Package.itmsp", "-u #{Shellwords.escape(@account)}", "-p #{Shellwords.escape(@password)}"]
49
49
  command = args.join(' ')
@@ -53,6 +53,8 @@ module Shenzhen::Plugins
53
53
  output = `#{command} 2> /dev/null`
54
54
  puts output.chomp if $verbose
55
55
 
56
+ raise "Failed to upload package to iTunes Connect" unless $?.exitstatus == 0
57
+
56
58
  output
57
59
  end
58
60
 
@@ -0,0 +1,81 @@
1
+ require 'json'
2
+ require 'openssl'
3
+ require 'faraday'
4
+ require 'faraday_middleware'
5
+
6
+ module Shenzhen::Plugins
7
+ module RivieraBuild
8
+ class Client
9
+ HOSTNAME = 'apps.rivierabuild.com'
10
+
11
+ def initialize(api_token)
12
+ @api_token = api_token
13
+ @connection = Faraday.new(:url => "https://#{HOSTNAME}", :request => { :timeout => 120 }) do |builder|
14
+ builder.request :multipart
15
+ builder.request :url_encoded
16
+ builder.response :json, :content_type => /\bjson$/
17
+ builder.use FaradayMiddleware::FollowRedirects
18
+ builder.adapter :net_http
19
+ end
20
+ end
21
+
22
+ def upload_build(ipa, options)
23
+ options[:file] = Faraday::UploadIO.new(ipa, 'application/octet-stream') if ipa and File.exist?(ipa)
24
+
25
+ @connection.post do |req|
26
+ req.url("/api/upload")
27
+ req.body = options
28
+ end.on_complete do |env|
29
+ yield env[:status], env[:body] if block_given?
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
35
+
36
+ command :'distribute:rivierabuild' do |c|
37
+ c.syntax = "ipa distribute:rivierabuild [options]"
38
+ c.summary = "Distribute an .ipa file over RivieraBuild"
39
+ c.description = ""
40
+ c.option '-f', '--file FILE', ".ipa file for the build"
41
+ c.option '-k', '--key KEY', "API KEY. Available at https://apps.rivierabuild.com/settings"
42
+ c.option '-a', '--availability AVAILABILITY', "For how long the build will be available? More info: http://api.rivierabuild.com"
43
+ c.option '-p', '--passcode PASSCODE', "Optional passcode required to install the build on a device"
44
+ c.option '-n', '--note NOTE', "Release notes for the build, Markdown"
45
+ c.option '--commit-sha SHA', "The Git commit SHA for this build"
46
+ c.option '--app-id', "Riviera Build Application ID"
47
+
48
+ c.action do |args, options|
49
+ determine_file! unless @file = options.file
50
+ say_warning "Missing or unspecified .ipa file" unless @file and File.exist?(@file)
51
+
52
+ determine_rivierabuild_api_token! unless @api_token = options.key || ENV['RIVIERA_API_KEY']
53
+ say_error "Missing API Token" and abort unless @api_token
54
+
55
+ determine_availability! unless @availability = options.availability
56
+ say_error "Missing availability" and abort unless @availability
57
+
58
+ parameters = {}
59
+ parameters[:api_key] = @api_token
60
+ parameters[:availability] = @availability
61
+ parameters[:passcode] = options.passcode if options.passcode
62
+ parameters[:app_id] = options.app_id if options.app_id
63
+ parameters[:note] = options.note if options.note
64
+ parameters[:commit_sha] = options.commit_sha if options.commit_sha
65
+
66
+ client = Shenzhen::Plugins::RivieraBuild::Client.new(@api_token)
67
+ response = client.upload_build(@file, parameters)
68
+ case response.status
69
+ when 200...300
70
+ say_ok "Build successfully uploaded to RivieraBuild: #{response.body['file_url']}"
71
+ else
72
+ say_error "Error uploading to RivieraBuild: #{response.body}"
73
+ end
74
+ end
75
+
76
+ private
77
+
78
+ def determine_rivierabuild_api_token!
79
+ @api_token ||= ask "API Key:"
80
+ end
81
+ end
@@ -0,0 +1,99 @@
1
+ require 'json'
2
+ require 'openssl'
3
+ require 'faraday'
4
+ require 'faraday_middleware'
5
+
6
+ module Shenzhen::Plugins
7
+ module TestFairy
8
+ class Client
9
+ HOSTNAME = 'app.testfairy.com'
10
+
11
+ def initialize(api_key)
12
+ @api_key = api_key
13
+ @connection = Faraday.new(:url => "https://#{HOSTNAME}") do |builder|
14
+ builder.request :multipart
15
+ builder.request :url_encoded
16
+ builder.response :json, :content_type => /\bjson$/
17
+ builder.use FaradayMiddleware::FollowRedirects
18
+ builder.adapter :net_http
19
+ end
20
+ end
21
+
22
+ def upload_build(ipa, options)
23
+ options[:file] = Faraday::UploadIO.new(ipa, 'application/octet-stream') if ipa and File.exist?(ipa)
24
+
25
+ if symbols_file = options.delete(:symbols_file)
26
+ options[:symbols_file] = Faraday::UploadIO.new(symbols_file, 'application/octet-stream')
27
+ end
28
+
29
+ @connection.post do |req|
30
+ req.url("/api/upload/")
31
+ req.body = options
32
+ end.on_complete do |env|
33
+ yield env[:status], env[:body] if block_given?
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
39
+
40
+ command :'distribute:testfairy' do |c|
41
+ c.syntax = "ipa distribute:testfairy [options]"
42
+ c.summary = "Distribute an .ipa file over TestFairy"
43
+ c.description = ""
44
+ c.option '-f', '--file FILE', ".ipa file for the build"
45
+ c.option '-d', '--dsym FILE', "zipped .dsym package for the build"
46
+ c.option '-a', '--key KEY', "API Key. Available at https://app.testfairy.com/settings for details."
47
+ c.option '-c', '--comment COMMENT', "Comment for the build"
48
+ c.option '--tester-groups GROUPS', 'Comma-separated list of tester groups to be notified on the new build. Or "all" to notify all testers.'
49
+ c.option '--metrics METRICS', "Comma-separated list of metrics to record"
50
+ c.option '--max-duration DURATION', 'Maximum session recording length, eg 20m or 1h. Default is "10m". Maximum 24h.'
51
+ c.option '--video ACTIVE', 'Video recording settings "on", "off" or "wifi" for recording video only when wifi is available. Default is "on".'
52
+ c.option '--video-quality QUALITY', 'Video quality settings, "high", "medium" or "low". Default is "high".'
53
+ c.option '--video-rate RATE', 'Video rate recording in frames per second, default is "1.0".'
54
+ c.option '--icon-watermark ADD', 'Add a small watermark to app icon. Default is "off".'
55
+
56
+ c.action do |args, options|
57
+ determine_file! unless @file = options.file
58
+ say_warning "Missing or unspecified .ipa file" unless @file and File.exist?(@file)
59
+
60
+ determine_dsym! unless @dsym = options.dsym
61
+ say_warning "Specified dSYM.zip file doesn't exist" if @dsym and !File.exist?(@dsym)
62
+
63
+ determine_testfairy_api_key! unless @api_key = options.key || ENV['TESTFAIRY_API_KEY']
64
+ say_error "Missing API Key" and abort unless @api_key
65
+
66
+ determine_notes! unless @comment = options.comment
67
+ say_error "Missing release comment" and abort unless @comment
68
+
69
+ parameters = {}
70
+ # Required
71
+ parameters[:api_key] = @api_key
72
+ # Optional
73
+ parameters[:comment] = @comment
74
+ parameters[:symbols_file] = @dsym if @dsym
75
+ parameters[:testers_groups] = options.testers_groups if options.testers_groups
76
+ parameters[:'max-duration'] = options.max_duration if options.max_duration
77
+ parameters[:video] = options.video if options.video
78
+ parameters[:'video-quality'] = options.video_quality if options.video_quality
79
+ parameters[:'video-rate'] = options.video_rate if options.video_rate
80
+ parameters[:'icon-watermark'] = options.icon_watermark if options.icon_watermark
81
+ parameters[:metrics] = options.metrics if options.metrics
82
+
83
+
84
+ client = Shenzhen::Plugins::TestFairy::Client.new(@api_key)
85
+ response = client.upload_build(@file, parameters)
86
+ case response.status
87
+ when 200...300
88
+ say_ok "Build successfully uploaded to TestFairy"
89
+ else
90
+ say_error "Error uploading to TestFairy: #{response.body}"
91
+ end
92
+ end
93
+
94
+ private
95
+
96
+ def determine_testfairy_api_key!
97
+ @api_key ||= ask "API Key:"
98
+ end
99
+ end
@@ -1,3 +1,3 @@
1
1
  module Shenzhen
2
- VERSION = '0.13.2'
2
+ VERSION = '0.14.0'
3
3
  end
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shenzhen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.2
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mattt Thompson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-13 00:00:00.000000000 Z
11
+ date: 2015-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commander
@@ -228,13 +228,16 @@ files:
228
228
  - ./lib/shenzhen/plugins/hockeyapp.rb
229
229
  - ./lib/shenzhen/plugins/itunesconnect.rb
230
230
  - ./lib/shenzhen/plugins/pgyer.rb
231
+ - ./lib/shenzhen/plugins/rivierabuild.rb
231
232
  - ./lib/shenzhen/plugins/s3.rb
233
+ - ./lib/shenzhen/plugins/testfairy.rb
232
234
  - ./lib/shenzhen/version.rb
233
235
  - ./lib/shenzhen/xcodebuild.rb
234
236
  - ./lib/shenzhen.rb
235
237
  - ./LICENSE
236
238
  - ./Rakefile
237
239
  - ./README.md
240
+ - ./shenzhen-0.13.2.gem
238
241
  - ./shenzhen.gemspec
239
242
  - bin/ipa
240
243
  homepage: http://nomad-cli.com