shenzhen 0.7.1 → 0.8.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: 597cbd4b75518f01a6a5990f47e4541ce50fbd1f
4
- data.tar.gz: 09737e8143cf28a07e9e1fdc8341a63a227c7bad
3
+ metadata.gz: 41fbea6a348b6faa6ec8516a81c1d37328e0c62b
4
+ data.tar.gz: b56480983fb412b9b5e32bdae83aa69c0a986e07
5
5
  SHA512:
6
- metadata.gz: 603cc218c04e3aa7bc1ac47f7868d27d96e45828f6a3fa4f5e8846ba0c947566af1807046459328384b97a047d082dc8cdb0bea6c3253fc8ccfb2141a059052d
7
- data.tar.gz: bca0ef76a75ca08b7a1da37e36ee80fab91442a19f989b18e5f7c93d0c361bb78ed00c5f18bfbdcc352072f0704462616c447c5d05887f174af4c38993d2749b
6
+ metadata.gz: 118b437781c43dc2076c71eb0802048b72e1cf2772e7f2719353a99a3b0192f61c75ab8c4d6c2737742e1571033da86e079041d222a239fd570d2985dd909216
7
+ data.tar.gz: 793f40936c249c90c0d020fb4b04ab1a783f5fc572791127f626ddd0fef42bbd00bc35fe672ac56a3de1c70f0907bf4434b33b04abdcaeaf0c0c21affa63816a
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shenzhen (0.7.1)
4
+ shenzhen (0.8.2)
5
5
  aws-sdk (~> 1.0)
6
6
  commander (~> 4.1)
7
7
  dotenv (~> 0.7)
@@ -11,12 +11,13 @@ PATH
11
11
  net-sftp (~> 2.1.2)
12
12
  plist (~> 3.1.0)
13
13
  rubyzip (~> 1.1)
14
+ security (~> 0.1.3)
14
15
  terminal-table (~> 1.4.5)
15
16
 
16
17
  GEM
17
18
  remote: https://rubygems.org/
18
19
  specs:
19
- aws-sdk (1.40.2)
20
+ aws-sdk (1.50.0)
20
21
  json (~> 1.4)
21
22
  nokogiri (>= 1.4.4)
22
23
  commander (4.2.0)
@@ -36,7 +37,7 @@ GEM
36
37
  net-sftp (2.1.2)
37
38
  net-ssh (>= 2.6.5)
38
39
  net-ssh (2.9.1)
39
- nokogiri (1.6.2.1)
40
+ nokogiri (1.6.3.1)
40
41
  mini_portile (= 0.6.0)
41
42
  plist (3.1.0)
42
43
  rake (10.3.1)
@@ -48,7 +49,8 @@ GEM
48
49
  rspec-expectations (2.14.5)
49
50
  diff-lcs (>= 1.1.3, < 2.0)
50
51
  rspec-mocks (2.14.6)
51
- rubyzip (1.1.3)
52
+ rubyzip (1.1.6)
53
+ security (0.1.3)
52
54
  terminal-table (1.4.5)
53
55
 
54
56
  PLATFORMS
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ![Shenzhen](https://raw.github.com/mattt/nomad-cli.com/assets/shenzhen-banner.png)
2
2
 
3
- Create `.ipa` files and then distribute them with [TestFlight](https://testflightapp.com/) or [HockeyApp](http://www.hockeyapp.net) or [DeployGate](https://deploygate.com), all from the command line!
3
+ Create `.ipa` files and then distribute them with [TestFlight](https://testflightapp.com/), [HockeyApp](http://www.hockeyapp.net), [DeployGate](https://deploygate.com), or even through [iTunes Connect](https://itunesconnect.apple.com)—all from the command line!
4
4
 
5
5
  Less cumbersome than clicking around in Xcode, and less hassle than rolling your own build script--Shenzhen radically improves the process of getting new builds out to testers and enterprises.
6
6
 
@@ -9,7 +9,9 @@ Less cumbersome than clicking around in Xcode, and less hassle than rolling your
9
9
 
10
10
  ## Installation
11
11
 
12
- $ gem install shenzhen
12
+ ```
13
+ $ gem install shenzhen
14
+ ```
13
15
 
14
16
  ### JSON Build Error
15
17
 
@@ -19,92 +21,123 @@ Users running Mac OS X Mavericks with Xcode 5.1 may encounter an error when atte
19
21
 
20
22
  To work around this, install the `json` gem first with the following command:
21
23
 
22
- $ ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install json
23
-
24
+ ```
25
+ $ ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install json
26
+ ```
24
27
 
25
28
  ## Usage
26
29
 
30
+ > For best results, set your environment localization to UTF-8, with `$ export LC_ALL="en_US.UTF-8"`. Otherwise, Shenzhen may return unexpectedly with the error "invalid byte sequence in US-ASCII".
31
+
27
32
  Shenzhen adds the `ipa` command to your PATH:
28
33
 
29
- $ ipa
34
+ ```
35
+ $ ipa
30
36
 
31
- Build and distribute iOS apps (.ipa files)
37
+ Build and distribute iOS apps (.ipa files)
32
38
 
33
- Commands:
34
- build Create a new .ipa file for your app
35
- distribute:testflight Distribute an .ipa file over TestFlight
36
- distribute:hockeyapp Distribute an .ipa file over HockeyApp
37
- distribute:deploygate Distribute an .ipa file over deploygate
38
- distribute:ftp Distribute an .ipa file over FTP
39
- distribute:S3 Distribute an .ipa file over Amazon S3
40
- info Show mobile provisioning information about an .ipa file
41
- help Display global or [command] help documentation.
39
+ Commands:
40
+ build Create a new .ipa file for your app
41
+ distribute:testflight Distribute an .ipa file over TestFlight
42
+ distribute:hockeyapp Distribute an .ipa file over HockeyApp
43
+ distribute:deploygate Distribute an .ipa file over deploygate
44
+ distribute:itunesconnect Upload an .ipa file to iTunes Connect for review
45
+ distribute:ftp Distribute an .ipa file over FTP
46
+ distribute:S3 Distribute an .ipa file over Amazon S3
47
+ info Show mobile provisioning information about an .ipa file
48
+ help Display global or [command] help documentation.
42
49
 
43
- Aliases:
44
- distribute distribute:testflight
50
+ Aliases:
51
+ distribute distribute:testflight
45
52
 
46
- Global Options:
47
- -h, --help Display help documentation
48
- -v, --version Display version information
49
- -t, --trace Display backtrace when an error occurs
53
+ Global Options:
54
+ -h, --help Display help documentation
55
+ -v, --version Display version information
56
+ -t, --trace Display backtrace when an error occurs
57
+ ```
50
58
 
51
59
  ### Building & Distribution
52
60
 
53
- $ cd /path/to/iOS Project/
54
- $ ipa build
55
- $ ipa distribute
61
+ ```
62
+ $ cd /path/to/iOS Project/
63
+ $ ipa build
64
+ $ ipa distribute
65
+ ```
56
66
 
57
67
  #### TestFlight Distribution
58
68
 
59
- $ ipa distribute:testflight -a API_TOKEN -T TEAM_TOKEN
69
+ ```
70
+ $ ipa distribute:testflight -a API_TOKEN -T TEAM_TOKEN
71
+ ```
60
72
 
61
73
  > Shenzhen will load credentials from the environment variables `TESTFLIGHT_API_TOKEN` and `TESTFLIGHT_TEAM_TOKEN` unless otherwise specified.
62
74
 
63
75
  #### HockeyApp Distribution
64
76
 
65
- $ ipa distribute:hockeyapp --token API_TOKEN
77
+ ```
78
+ $ ipa distribute:hockeyapp --token API_TOKEN
79
+ ```
66
80
 
67
81
  > Shenzhen will load credentials from the environment variable `HOCKEYAPP_API_TOKEN` unless otherwise specified.
68
82
 
69
83
  #### DeployGate Distribution
70
84
 
71
- $ ipa distribute:deploygate -a API_TOKEN -u USER_NAME
85
+ ```
86
+ $ ipa distribute:deploygate -a API_TOKEN -u USER_NAME
87
+ ```
72
88
 
73
89
  > Shenzhen will load credentials from the environment variable `DEPLOYGATE_API_TOKEN` and `DEPLOYGATE_USER_NAME` unless otherwise specified.
74
90
 
75
-
76
91
  #### FTP Distribution
77
92
 
78
- $ ipa distribute:ftp --host HOST -u USER -p PASSWORD -P FTP_PATH
93
+ ```
94
+ $ ipa distribute:ftp --host HOST -u USER -p PASSWORD -P FTP_PATH
95
+ ```
79
96
 
80
97
  #### SFTP Distribution
81
98
 
82
- $ ipa distribute:sftp --host HOST -u USER -p PASSWORD -P FTP_PATH
99
+ ```
100
+ $ ipa distribute:sftp --host HOST -u USER -p PASSWORD -P FTP_PATH
101
+ ```
83
102
 
84
103
  #### Amazon S3 Distribution
85
104
 
86
- $ ipa distribute:s3 -a ACCESS_KEY_ID -s SECRET_ACCESS_KEY -b BUCKET
105
+ ```
106
+ $ ipa distribute:s3 -a ACCESS_KEY_ID -s SECRET_ACCESS_KEY -b BUCKET
107
+ ```
108
+
109
+ > Shenzhen will load credentials from the environment variables `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY` and `AWS_REGION` unless otherwise specified.
110
+
111
+ #### iTunes Connect Distribution
112
+
113
+ $ ipa distribute:itunesconnect -a me@email.com -p myitunesconnectpassword --upload
87
114
 
88
- > Shenzhen will load credentials from the environment variable `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY` and `AWS_REGION` unless otherwise specified.
115
+ > Shenzhen will load credentials from the environment variables `ITUNES_CONNECT_ACCOUNT` and `ITUNES_CONNECT_PASSWORD` unless otherwise specified. If only an account is provided, the keychain will be searched for a matching entry.
116
+ >
117
+ > If the `--upload` flag is omitted, Shenzen will validate the given credentials and check that the app is in the 'Waiting for Upload' state on iTunes Connect but will not upload the .ipa
118
+ >
119
+ > For a fully hands-free upload, in a CI environment for example, ensure your iTunes Connect credentials are stored in your keychain, and that the keychain item has the Validation app in it's 'Always allow access' list. Running Shenzhen once with the `--save-keychain` flag, and clicking `Always Allow` on the prompt will set this up for you.
89
120
 
90
121
  ### Displaying Embedded .mobileprovision Information
91
122
 
92
- $ ipa info /path/to/app.ipa
93
-
94
- +-----------------------------+----------------------------------------------------------+
95
- | ApplicationIdentifierPrefix | DJ73OPSO53 |
96
- | CreationDate | 2014-03-26T02:53:00+00:00 |
97
- | Entitlements | application-identifier: DJ73OPSO53.com.nomad.shenzhen |
98
- | | aps-environment: production |
99
- | | get-task-allow: false |
100
- | | keychain-access-groups: ["DJ73OPSO53.*"] |
101
- | CreationDate | 2017-03-26T02:53:00+00:00 |
102
- | Name | Shenzhen |
103
- | TeamIdentifier | S6ZYP4L6TY |
104
- | TimeToLive | 172 |
105
- | UUID | P7602NR3-4D34-441N-B6C9-R79395PN1OO3 |
106
- | Version | 1 |
107
- +-----------------------------+----------------------------------------------------------+
123
+ ```
124
+ $ ipa info /path/to/app.ipa
125
+
126
+ +-----------------------------+----------------------------------------------------------+
127
+ | ApplicationIdentifierPrefix | DJ73OPSO53 |
128
+ | CreationDate | 2014-03-26T02:53:00+00:00 |
129
+ | Entitlements | application-identifier: DJ73OPSO53.com.nomad.shenzhen |
130
+ | | aps-environment: production |
131
+ | | get-task-allow: false |
132
+ | | keychain-access-groups: ["DJ73OPSO53.*"] |
133
+ | CreationDate | 2017-03-26T02:53:00+00:00 |
134
+ | Name | Shenzhen |
135
+ | TeamIdentifier | S6ZYP4L6TY |
136
+ | TimeToLive | 172 |
137
+ | UUID | P7602NR3-4D34-441N-B6C9-R79395PN1OO3 |
138
+ | Version | 1 |
139
+ +-----------------------------+----------------------------------------------------------+
140
+ ```
108
141
 
109
142
  ## Contact
110
143
 
@@ -2,9 +2,10 @@ $:.push File.expand_path('../', __FILE__)
2
2
 
3
3
  require 'plugins/testflight'
4
4
  require 'plugins/hockeyapp'
5
+ require 'plugins/deploygate'
6
+ require 'plugins/itunesconnect'
5
7
  require 'plugins/ftp'
6
8
  require 'plugins/s3'
7
- require 'plugins/deploygate'
8
9
 
9
10
  require 'commands/build'
10
11
  require 'commands/distribute'
@@ -100,7 +100,6 @@ command :'distribute:hockeyapp' do |c|
100
100
  case response.status
101
101
  when 200...300
102
102
  say_ok "Build successfully uploaded to HockeyApp"
103
- return response.body
104
103
  else
105
104
  say_error "Error uploading to HockeyApp: #{response.body}"
106
105
  end
@@ -0,0 +1,109 @@
1
+ require 'security'
2
+
3
+ module Shenzhen::Plugins
4
+ module ITunesConnect
5
+ ITUNES_CONNECT_SERVER = 'Xcode:itunesconnect.apple.com'
6
+
7
+ class Client
8
+ attr_reader :ipa, :sdk, :params
9
+
10
+ def initialize(ipa, sdk, params = [])
11
+ @ipa = ipa
12
+ @sdk = sdk
13
+ @params = params
14
+ end
15
+
16
+ def ensure_itunesconnect!
17
+ case xcrun(:Validation, [:online])
18
+ when /(error)|(fail)/i
19
+ say_error "An error occurred checking the status of the app in iTunes Connect.\nRun with --verbose for more info." and abort
20
+ when /validation was skipped/i
21
+ say_error "Validation was skipped. Double check your credentials and ensure the app in the 'Waiting for Upload' state." and abort
22
+ end
23
+ end
24
+
25
+ def upload_build!
26
+ case xcrun(:Validation, [:online, :upload])
27
+ when /(error)|(fail)/i
28
+ say_error "An error occurred when trying to upload the build to iTunesConnect.\nRun with --verbose for more info." and abort
29
+ end
30
+ end
31
+
32
+ private
33
+
34
+ def xcrun(tool, options = [])
35
+ args = ["xcrun", "-sdk #{sdk}", tool] + (options + @params).collect{|o| "-#{o}"} + [ipa, '2>&1']
36
+ command = args.join(' ')
37
+
38
+ say "#{command}" if verbose?
39
+
40
+ output = `#{command}`
41
+ say output.chomp if verbose?
42
+
43
+ return output
44
+ end
45
+
46
+ def verbose?
47
+ @params.collect(&:to_sym).include?(:verbose)
48
+ end
49
+ end
50
+ end
51
+ end
52
+
53
+ command :'distribute:itunesconnect' do |c|
54
+ c.syntax = "ipa distribute:itunesconnect [options]"
55
+ c.summary = "Upload an .ipa file to iTunes Connect"
56
+ c.description = "Upload an .ipa file directly to iTunes Connect for review. Requires that the app is in the 'Waiting for upload' state and the --upload flag to be set."
57
+ c.option '-f', '--file FILE', ".ipa file for the build"
58
+ c.option '-a', '--account ACCOUNT', "Apple ID used to log into https://itunesconnect.apple.com"
59
+ c.option '-p', '--password PASSWORD', "Password for the account unless already stored in the keychain"
60
+ c.option '-u', '--upload', "Actually attempt to upload the build to iTunes Connect"
61
+ c.option '-w', '--warnings', "Check for warnings when validating the ipa"
62
+ c.option '-e', '--errors', "Check for errors when validating the ipa"
63
+ c.option '--verbose', "Run commands verbosely"
64
+ c.option '--sdk SDK', "SDK to use when validating the ipa. Defaults to 'iphoneos'"
65
+ c.option '--save-keychain', "Save the provided account in the keychain for future use"
66
+
67
+ c.action do |args, options|
68
+ options.default :upload => false, :sdk => 'iphoneos', :save_keychain => true
69
+
70
+ determine_file! unless @file = options.file
71
+ say_error "Missing or unspecified .ipa file" and abort unless @file and File.exist?(@file)
72
+
73
+ determine_itunes_connect_account! unless @account = options.account || ENV['ITUNES_CONNECT_ACCOUNT']
74
+ say_error "Missing iTunes Connect account" and abort unless @account
75
+
76
+ @password = options.password || ENV['ITUNES_CONNECT_PASSWORD']
77
+ if @password ||= Security::GenericPassword.find(:s => Shenzhen::Plugins::ITunesConnect::ITUNES_CONNECT_SERVER, :a => @account)
78
+ say_ok "Found password in keychain for account: #{@account}" if options.verbose
79
+ else
80
+ determine_itunes_connect_password! unless @password
81
+ say_error "Missing iTunes Connect password" and abort unless @password
82
+
83
+ Security::GenericPassword.add(Shenzhen::Plugins::ITunesConnect::ITUNES_CONNECT_SERVER, @account, @password, {:U => nil}) if options.save_keychain
84
+ end
85
+
86
+ parameters = []
87
+ parameters << :verbose if options.verbose
88
+ parameters << :warnings if options.warnings
89
+ parameters << :errors if options.errors
90
+
91
+ client = Shenzhen::Plugins::ITunesConnect::Client.new(@file, options.sdk, parameters)
92
+
93
+ client.ensure_itunesconnect!
94
+ say_warning "Upload not requested, skipping." and abort unless options.upload
95
+
96
+ client.upload_build!
97
+ say_ok "Upload complete. You may want to double check iTunes Connect to make sure it was received correctly."
98
+ end
99
+
100
+ private
101
+
102
+ def determine_itunes_connect_account!
103
+ @account ||= ask "iTunes Connect account:"
104
+ end
105
+
106
+ def determine_itunes_connect_password!
107
+ @password ||= password "iTunes Connect password:"
108
+ end
109
+ end
@@ -82,7 +82,6 @@ command :'distribute:testflight' do |c|
82
82
  case response.status
83
83
  when 200...300
84
84
  say_ok "Build successfully uploaded to TestFlight"
85
- return response.body
86
85
  else
87
86
  say_error "Error uploading to TestFlight: #{response.body}" and abort
88
87
  end
@@ -1,3 +1,3 @@
1
1
  module Shenzhen
2
- VERSION = '0.7.1'
2
+ VERSION = '0.8.2'
3
3
  end
Binary file
Binary file
@@ -24,6 +24,7 @@ Gem::Specification.new do |s|
24
24
  s.add_dependency "net-sftp", "~> 2.1.2"
25
25
  s.add_dependency "plist", "~> 3.1.0"
26
26
  s.add_dependency "rubyzip", "~> 1.1"
27
+ s.add_dependency "security", "~> 0.1.3"
27
28
 
28
29
  s.add_development_dependency "rspec"
29
30
  s.add_development_dependency "rake"
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.7.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mattt Thompson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-18 00:00:00.000000000 Z
11
+ date: 2014-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commander
@@ -150,6 +150,20 @@ dependencies:
150
150
  - - ~>
151
151
  - !ruby/object:Gem::Version
152
152
  version: '1.1'
153
+ - !ruby/object:Gem::Dependency
154
+ name: security
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ~>
158
+ - !ruby/object:Gem::Version
159
+ version: 0.1.3
160
+ type: :runtime
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ~>
165
+ - !ruby/object:Gem::Version
166
+ version: 0.1.3
153
167
  - !ruby/object:Gem::Dependency
154
168
  name: rspec
155
169
  requirement: !ruby/object:Gem::Requirement
@@ -196,6 +210,7 @@ files:
196
210
  - ./lib/shenzhen/plugins/deploygate.rb
197
211
  - ./lib/shenzhen/plugins/ftp.rb
198
212
  - ./lib/shenzhen/plugins/hockeyapp.rb
213
+ - ./lib/shenzhen/plugins/itunesconnect.rb
199
214
  - ./lib/shenzhen/plugins/s3.rb
200
215
  - ./lib/shenzhen/plugins/testflight.rb
201
216
  - ./lib/shenzhen/version.rb
@@ -204,7 +219,8 @@ files:
204
219
  - ./LICENSE
205
220
  - ./Rakefile
206
221
  - ./README.md
207
- - ./shenzhen-0.7.0.gem
222
+ - ./shenzhen-0.8.0.gem
223
+ - ./shenzhen-0.8.1.gem
208
224
  - ./shenzhen.gemspec
209
225
  - bin/ipa
210
226
  homepage: http://nomad-cli.com
Binary file