shenzhen 0.6.1 → 0.7.0

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: 7684b311755d47b4edfd905f8c74806c10410cf5
4
- data.tar.gz: 7a0d95a54f775e20e6274c14883a6d8badd9593c
3
+ metadata.gz: 85602b6a9a8491276f05e77aa8e341cfe7a016b3
4
+ data.tar.gz: de056fb52dae78399884bc642923f64c10a2aeea
5
5
  SHA512:
6
- metadata.gz: 42cb845473ab5d6c5eb21c880fa89d78dec2d99336571aad857a1e20f88614ca04274e2699f1330cbea197029395a0cc442bddc9564898c49a60ed808fedeb18
7
- data.tar.gz: 3812a666ef03d6c6ef43b592d0383ee3e624124d2f5e9d12d1a49f7a497a85511b01f3dd5b5dfefc8e2beefb5eb00b49bdbacb381b371fb6b89c35260bd80bee
6
+ metadata.gz: 5f9a41eb3d14cc5952fc74665ce3178f4b9978258a8f0b0ae0eaacd2bd3672e41611433dac5cb09374613d9b3004b5c2c64f9ae54cec883a16536119b6602579
7
+ data.tar.gz: 9f034524a871061cc6a7635793060312b8a839e3f4b634874504cd8619c415b346ffd22b1b210ea29aae0a9c8a021b85ab7cb8eeaaa4bb16ab98608a9241b876
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shenzhen (0.6.1)
4
+ shenzhen (0.7.0)
5
5
  aws-sdk (~> 1.0)
6
6
  commander (~> 4.1)
7
7
  dotenv (~> 0.7)
@@ -20,7 +20,7 @@ GEM
20
20
  json (~> 1.4)
21
21
  nokogiri (>= 1.4.4)
22
22
  uuidtools (~> 2.1)
23
- commander (4.1.6)
23
+ commander (4.2.0)
24
24
  highline (~> 1.6.11)
25
25
  diff-lcs (1.2.5)
26
26
  dotenv (0.10.0)
@@ -38,7 +38,7 @@ GEM
38
38
  nokogiri (1.6.1)
39
39
  mini_portile (~> 0.5.0)
40
40
  plist (3.1.0)
41
- rake (10.2.1)
41
+ rake (10.3.1)
42
42
  rspec (2.14.1)
43
43
  rspec-core (~> 2.14.0)
44
44
  rspec-expectations (~> 2.14.0)
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), all from the command line!
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!
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
 
@@ -34,6 +34,7 @@ Shenzhen adds the `ipa` command to your PATH:
34
34
  build Create a new .ipa file for your app
35
35
  distribute:testflight Distribute an .ipa file over TestFlight
36
36
  distribute:hockeyapp Distribute an .ipa file over HockeyApp
37
+ distribute:deploygate Distribute an .ipa file over deploygate
37
38
  distribute:ftp Distribute an .ipa file over FTP
38
39
  distribute:S3 Distribute an .ipa file over Amazon S3
39
40
  info Show mobile provisioning information about an .ipa file
@@ -65,6 +66,13 @@ Shenzhen adds the `ipa` command to your PATH:
65
66
 
66
67
  > Shenzhen will load credentials from the environment variable `HOCKEYAPP_API_TOKEN` unless otherwise specified.
67
68
 
69
+ #### DeployGate Distribution
70
+
71
+ $ ipa distribute:deploygate -a API_TOKEN -u USER_NAME
72
+
73
+ > Shenzhen will load credentials from the environment variable `DEPLOYGATE_API_TOKEN` and `DEPLOYGATE_USER_NAME` unless otherwise specified.
74
+
75
+
68
76
  #### FTP Distribution
69
77
 
70
78
  $ ipa distribute:ftp --host HOST -u USER -p PASSWORD -P FTP_PATH
@@ -4,6 +4,7 @@ require 'plugins/testflight'
4
4
  require 'plugins/hockeyapp'
5
5
  require 'plugins/ftp'
6
6
  require 'plugins/s3'
7
+ require 'plugins/deploygate'
7
8
 
8
9
  require 'commands/build'
9
10
  require 'commands/distribute'
@@ -9,6 +9,7 @@ command :build do |c|
9
9
  c.option '-p', '--project PROJECT', 'Project (.xcodeproj) file to use to build app (automatically detected in current directory, overridden by --workspace option, if passed)'
10
10
  c.option '-c', '--configuration CONFIGURATION', 'Configuration used to build'
11
11
  c.option '-s', '--scheme SCHEME', 'Scheme used to build app'
12
+ c.option '--xcconfig XCCONFIG', 'use an extra XCCONFIG file to build the app'
12
13
  c.option '--[no-]clean', 'Clean project before building'
13
14
  c.option '--[no-]archive', 'Archive project after building'
14
15
  c.option '-d', '--destination DESTINATION', 'Destination. Defaults to current directory'
@@ -27,6 +28,7 @@ command :build do |c|
27
28
  @scheme = options.scheme
28
29
  @sdk = options.sdk || 'iphoneos'
29
30
  @configuration = options.configuration
31
+ @xcconfig = options.xcconfig
30
32
  @destination = options.destination || Dir.pwd
31
33
  FileUtils.mkdir_p(@destination) unless File.directory?(@destination)
32
34
 
@@ -43,11 +45,12 @@ command :build do |c|
43
45
  @configuration = options.configuration
44
46
 
45
47
  flags = []
46
- flags << "-sdk #{@sdk}"
47
- flags << "-workspace '#{@workspace}'" if @workspace
48
- flags << "-project '#{@project}'" if @project
49
- flags << "-scheme '#{@scheme}'" if @scheme
50
- flags << "-configuration '#{@configuration}'" if @configuration
48
+ flags << %{-sdk #{@sdk}}
49
+ flags << %{-workspace "#{@workspace}"} if @workspace
50
+ flags << %{-project "#{@project}"} if @project
51
+ flags << %{-scheme "#{@scheme}"} if @scheme
52
+ flags << %{-configuration "#{@configuration}"} if @configuration
53
+ flags << %{-xcconfig "#{@xcconfig}"} if @xcconfig
51
54
 
52
55
  @target, @xcodebuild_settings = Shenzhen::XcodeBuild.settings(*flags).detect{|target, settings| settings['WRAPPER_EXTENSION'] == "app"}
53
56
  say_error "App settings could not be found." and abort unless @xcodebuild_settings
@@ -0,0 +1,85 @@
1
+ require 'json'
2
+ require 'openssl'
3
+ require 'faraday'
4
+ require 'faraday_middleware'
5
+
6
+ module Shenzhen::Plugins
7
+ module DeployGate
8
+ class Client
9
+ HOSTNAME = 'deploygate.com'
10
+
11
+ def initialize(api_token, user_name)
12
+ @api_token, @user_name = api_token, user_name
13
+ @connection = Faraday.new(:url => "http://#{HOSTNAME}", :request => { :timeout => 120 }) do |builder|
14
+ builder.request :multipart
15
+ builder.request :json
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.update({
24
+ :token => @api_token,
25
+ :file => Faraday::UploadIO.new(ipa, 'application/octet-stream'),
26
+ :message => options[:message] || ''
27
+ })
28
+
29
+ @connection.post("/api/users/#{@user_name}/apps", options).on_complete do |env|
30
+ yield env[:status], env[:body] if block_given?
31
+ end
32
+
33
+ rescue Faraday::Error::TimeoutError
34
+ say_error "Timed out while uploading build. Check https://deploygate.com/ to see if the upload was completed." and abort
35
+ end
36
+ end
37
+ end
38
+ end
39
+
40
+ command :'distribute:deploygate' do |c|
41
+ c.syntax = "ipa distribute:deploygate [options]"
42
+ c.summary = "Distribute an .ipa file over deploygate"
43
+ c.description = ""
44
+ c.option '-f', '--file FILE', ".ipa file for the build"
45
+ c.option '-a', '--api_token TOKEN', "API Token. Available at https://deploygate.com/settings"
46
+ c.option '-u', '--user_name USER_NAME', "User Name. Available at https://deploygate.com/settings"
47
+ c.option '-m', '--message MESSAGE', "Release message for the build"
48
+
49
+ c.action do |args, options|
50
+ determine_file! unless @file = options.file
51
+ say_error "Missing or unspecified .ipa file" and abort unless @file and File.exist?(@file)
52
+
53
+ determine_deploygate_api_token! unless @api_token = options.api_token || ENV['DEPLOYGATE_API_TOKEN']
54
+ say_error "Missing API Token" and abort unless @api_token
55
+
56
+ determine_deploygate_user_name! unless @user_name = options.user_name || ENV['DEPLOYGATE_USER_NAME']
57
+ say_error "Missing User Name" and abort unless @api_token
58
+
59
+ @message = options.message
60
+
61
+ parameters = {}
62
+ parameters[:file] = @file
63
+ parameters[:message] = @message
64
+ parameters[:replace] = "true" if options.replace
65
+
66
+ client = Shenzhen::Plugins::DeployGate::Client.new(@api_token, @user_name)
67
+ response = client.upload_build(@file, parameters)
68
+ case response.status
69
+ when 200...300
70
+ say_ok "Build successfully uploaded to DeployGate"
71
+ else
72
+ say_error "Error uploading to DeployGate: #{response.body}" and abort
73
+ end
74
+ end
75
+
76
+ private
77
+
78
+ def determine_deploygate_api_token!
79
+ @api_token ||= ask "API Token:"
80
+ end
81
+
82
+ def determine_deploygate_user_name!
83
+ @user_name ||= ask "User Name:"
84
+ end
85
+ end
@@ -130,8 +130,11 @@ command :'distribute:ftp' do |c|
130
130
  determine_user! unless @user = options.user
131
131
  say_error "Missing FTP user" and abort unless @user
132
132
 
133
- determine_password! unless @password = options.password
134
- say_error "Missing FTP password" and abort unless @password
133
+ @password = options.password
134
+ if !@password && options.protocol != :sftp
135
+ determine_password!
136
+ say_error "Missing FTP password" and abort unless @password
137
+ end
135
138
 
136
139
  @path = options.path || ""
137
140
 
@@ -147,6 +150,7 @@ command :'distribute:ftp' do |c|
147
150
  say_ok "Build successfully uploaded to FTP"
148
151
  rescue => exception
149
152
  say_error "Error while uploading to FTP: #{exception}"
153
+ raise if options.trace
150
154
  end
151
155
  end
152
156
 
@@ -57,6 +57,9 @@ command :'distribute:hockeyapp' do |c|
57
57
  c.option '--notify', "Notify permitted teammates to install the build"
58
58
  c.option '--downloadOff', "Upload but don't allow download of this version just yet"
59
59
  c.option '--mandatory', "Make this update mandatory"
60
+ c.option '--commit-sha SHA', "The Git commit SHA for this build"
61
+ c.option '--build-server-url URL', "The URL of the build job on your build server"
62
+ c.option '--repository-url URL', "The URL of your source repository"
60
63
 
61
64
  c.action do |args, options|
62
65
  determine_file! unless @file = options.file
@@ -88,6 +91,9 @@ command :'distribute:hockeyapp' do |c|
88
91
  else
89
92
  "2"
90
93
  end
94
+ parameters[:commit_sha] = options.commit_sha if options.commit_sha
95
+ parameters[:build_server_url] = options.build_server_url if options.build_server_url
96
+ parameters[:repository_url] = options.repository_url if options.repository_url
91
97
 
92
98
  client = Shenzhen::Plugins::HockeyApp::Client.new(@api_token)
93
99
  response = client.upload_build(@file, parameters)
@@ -1,3 +1,3 @@
1
1
  module Shenzhen
2
- VERSION = '0.6.1'
2
+ VERSION = '0.7.0'
3
3
  end
data/shenzhen.gemspec CHANGED
@@ -7,6 +7,7 @@ Gem::Specification.new do |s|
7
7
  s.name = "shenzhen"
8
8
  s.authors = ["Mattt Thompson"]
9
9
  s.email = "m@mattt.me"
10
+ s.license = "MIT"
10
11
  s.homepage = "http://nomad-cli.com"
11
12
  s.version = Shenzhen::VERSION
12
13
  s.platform = Gem::Platform::RUBY
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.6.1
4
+ version: 0.7.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: 2014-04-11 00:00:00.000000000 Z
11
+ date: 2014-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commander
@@ -193,6 +193,7 @@ files:
193
193
  - ./lib/shenzhen/commands/info.rb
194
194
  - ./lib/shenzhen/commands.rb
195
195
  - ./lib/shenzhen/plistbuddy.rb
196
+ - ./lib/shenzhen/plugins/deploygate.rb
196
197
  - ./lib/shenzhen/plugins/ftp.rb
197
198
  - ./lib/shenzhen/plugins/hockeyapp.rb
198
199
  - ./lib/shenzhen/plugins/s3.rb
@@ -203,11 +204,11 @@ files:
203
204
  - ./LICENSE
204
205
  - ./Rakefile
205
206
  - ./README.md
206
- - ./shenzhen-0.6.0.gem
207
207
  - ./shenzhen.gemspec
208
208
  - bin/ipa
209
209
  homepage: http://nomad-cli.com
210
- licenses: []
210
+ licenses:
211
+ - MIT
211
212
  metadata: {}
212
213
  post_install_message:
213
214
  rdoc_options: []
data/shenzhen-0.6.0.gem DELETED
Binary file