motion-provisioning 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -0
- data/bin/export_private_key +0 -0
- data/lib/motion-provisioning/certificate.rb +5 -8
- data/lib/motion-provisioning/provisioning_profile.rb +4 -6
- data/lib/motion-provisioning/tasks.rb +1 -0
- data/lib/motion-provisioning/version.rb +1 -1
- data/lib/motion-provisioning.rb +16 -5
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6480835dcdaa3b70bc6caa3a56747421f36fd7f1
|
4
|
+
data.tar.gz: 5bdcb55cce435824748780b75568ae4369a86ff6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23c13056f0e01ea8829d0739d3c2d260cdd74a3d9d32cf6a1f65f6ddb99670cea525626017267e6e28cbaa62fb8d7cdd55d882db953f3df6e16181608c5e1e23
|
7
|
+
data.tar.gz: 9031b87d874d1f81f3d37be3c699c2a4b900d3e141456d25034f3a6ec8f81b1ebd72634bdaf5622f79ab3cca206411e7c11e36241ab44743039863d61250ea14
|
data/README.md
CHANGED
@@ -107,6 +107,12 @@ The certificates and profiles will be created and downloaded into a
|
|
107
107
|
`provisioning` folder in the root of your application folder as part of running
|
108
108
|
`rake archive:distribution` or `rake device`.
|
109
109
|
|
110
|
+
The output path can be configured by setting `MotionProvisioning.output_path`:
|
111
|
+
|
112
|
+
```ruby
|
113
|
+
MotionProvisioning.output_path = '../my_provisioning'
|
114
|
+
```
|
115
|
+
|
110
116
|
## Developer account
|
111
117
|
|
112
118
|
The first time you run MotionProvisioning, you will be asked for your Apple ID
|
data/bin/export_private_key
CHANGED
Binary file
|
@@ -13,9 +13,9 @@ module MotionProvisioning
|
|
13
13
|
def certificate_name(type, platform)
|
14
14
|
self.type = type
|
15
15
|
self.platform = platform
|
16
|
-
self.output_path =
|
17
|
-
certificate_path = File.
|
18
|
-
private_key_path = File.
|
16
|
+
self.output_path = MotionProvisioning.output_path
|
17
|
+
certificate_path = File.join(output_path, "#{platform}_#{type}_certificate.cer")
|
18
|
+
private_key_path = File.join(output_path, "#{platform}_#{type}_private_key.p12")
|
19
19
|
|
20
20
|
# First check if there is a certificate and key file, and if it is installed
|
21
21
|
identities = available_identities
|
@@ -35,9 +35,6 @@ module MotionProvisioning
|
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
|
-
# Create the folder to store the certs
|
39
|
-
FileUtils.mkdir_p(File.expand_path('./provisioning'))
|
40
|
-
|
41
38
|
# Make sure a client is created and logged in
|
42
39
|
client
|
43
40
|
|
@@ -194,9 +191,9 @@ module MotionProvisioning
|
|
194
191
|
Utils.log("Info", "Successfully installed certificate.")
|
195
192
|
|
196
193
|
if self.type == :distribution
|
197
|
-
Utils.log("Warning", "You have just created a distribution certificate. These certificates must be shared with other team members by sending them the private key (.p12) and certificate (.cer) files in your
|
194
|
+
Utils.log("Warning", "You have just created a distribution certificate. These certificates must be shared with other team members by sending them the private key (.p12) and certificate (.cer) files in your output folder and install them in the keychain.")
|
198
195
|
else
|
199
|
-
Utils.log("Warning", "You have just created a development certificate. If you want to use this certificate on another machine, transfer the private key (.p12) and certificate (.cer) files in your
|
196
|
+
Utils.log("Warning", "You have just created a development certificate. If you want to use this certificate on another machine, transfer the private key (.p12) and certificate (.cer) files in your output folder and install them in the keychain.")
|
200
197
|
end
|
201
198
|
Utils.ask("Info", "Press any key to continue...")
|
202
199
|
|
@@ -10,20 +10,18 @@ module MotionProvisioning
|
|
10
10
|
def provisioning_profile(bundle_id, app_name, platform, type)
|
11
11
|
self.type = type
|
12
12
|
self.platform = platform
|
13
|
-
|
13
|
+
output_path = MotionProvisioning.output_path
|
14
|
+
provisioning_profile_path = File.join(output_path, "#{bundle_id}_#{platform}_#{type}_provisioning_profile.mobileprovision")
|
14
15
|
provisioning_profile_name = "(MotionProvisioning) #{bundle_id} #{platform} #{type}"
|
15
16
|
certificate_type = type == :development ? :development : :distribution
|
16
17
|
certificate_platform = platform == :mac ? :mac : :ios
|
17
|
-
certificate_path = File.
|
18
|
+
certificate_path = File.join(output_path, "#{certificate_platform}_#{certificate_type}_certificate.cer")
|
18
19
|
if !File.exist?(certificate_path)
|
19
20
|
Utils.log('Error', "Couldn't find the certificate in path '#{certificate_path}'.")
|
20
21
|
Utils.log('Error', "Make sure you're configuring the certificate *before* the provisioning profile in the Rakefile.")
|
21
22
|
abort
|
22
23
|
end
|
23
24
|
|
24
|
-
# Create the folder to store the certs
|
25
|
-
FileUtils.mkdir_p(File.expand_path('./provisioning'))
|
26
|
-
|
27
25
|
if File.exist?(provisioning_profile_path) && ENV['recreate_profile'].nil?
|
28
26
|
mobileprovision = MobileProvision.new(provisioning_profile_path)
|
29
27
|
if mobileprovision.valid?(certificate_path, MotionProvisioning.entitlements)
|
@@ -78,7 +76,7 @@ module MotionProvisioning
|
|
78
76
|
client.development_certificates(mac: platform == :mac).map { |c| Spaceship::Portal::Certificate.factory(c) }
|
79
77
|
else
|
80
78
|
certificate_platform = platform == :mac ? :mac : :ios
|
81
|
-
certificate_sha1 = OpenSSL::Digest::SHA1.new(File.read(File.
|
79
|
+
certificate_sha1 = OpenSSL::Digest::SHA1.new(File.read(File.join(output_path, "#{certificate_platform}_distribution_certificate.cer")))
|
82
80
|
cert = client.distribution_certificates(mac: platform == :mac).detect do |c|
|
83
81
|
OpenSSL::Digest::SHA1.new(c['certContent'].read) == certificate_sha1
|
84
82
|
end
|
data/lib/motion-provisioning.rb
CHANGED
@@ -27,6 +27,8 @@ module MotionProvisioning
|
|
27
27
|
def self.client
|
28
28
|
Spaceship::Portal.client ||= begin
|
29
29
|
|
30
|
+
FileUtils.mkdir_p(MotionProvisioning.output_path)
|
31
|
+
|
30
32
|
if File.exist?('.gitignore') && File.read('.gitignore').match(/^provisioning$/).nil?
|
31
33
|
answer = Utils.ask("Info", "Do you want to add the 'provisioning' folder fo your '.gitignore' file? (Recommended) (Y/n):")
|
32
34
|
`echo provisioning >> .gitignore` if answer.yes?
|
@@ -40,12 +42,11 @@ module MotionProvisioning
|
|
40
42
|
|
41
43
|
email = ENV['MOTION_PROVISIONING_EMAIL'] || MotionProvisioning.config['email'] || Utils.ask("Info", "Your Apple ID email:").answer
|
42
44
|
|
43
|
-
config_path = File.
|
45
|
+
config_path = File.join(MotionProvisioning.output_path, 'config.yaml')
|
44
46
|
|
45
47
|
if ENV['MOTION_PROVISIONING_EMAIL'].nil? && !File.exist?(config_path)
|
46
|
-
answer = Utils.ask("Info", "Do you want to save the email to the config file ('
|
48
|
+
answer = Utils.ask("Info", "Do you want to save the email to the config file ('#{MotionProvisioning.output_path}/config.yaml') so you dont have to type it again? (Y/n):")
|
47
49
|
if answer.yes?
|
48
|
-
FileUtils.mkdir_p(File.expand_path('./provisioning'))
|
49
50
|
File.write(config_path, { 'email' => email }.to_yaml)
|
50
51
|
end
|
51
52
|
end
|
@@ -115,7 +116,7 @@ module MotionProvisioning
|
|
115
116
|
team_id = client.select_team
|
116
117
|
|
117
118
|
if File.exist?(config_path) && ENV['MOTION_PROVISIONING_TEAM_ID'].nil?
|
118
|
-
answer = Utils.ask("Info", "Do you want to save the team id (#{team_id}) in the config file ('
|
119
|
+
answer = Utils.ask("Info", "Do you want to save the team id (#{team_id}) in the config file ('#{MotionProvisioning.output_path}/config.yaml') so you dont have to select it again? (Y/n):")
|
119
120
|
if answer.yes?
|
120
121
|
config = YAML.load(File.read(config_path))
|
121
122
|
config['team_id'] = team_id
|
@@ -141,7 +142,7 @@ module MotionProvisioning
|
|
141
142
|
|
142
143
|
def self.config
|
143
144
|
return @config if @config
|
144
|
-
config_path = File.
|
145
|
+
config_path = File.join(MotionProvisioning.output_path, 'config.yaml')
|
145
146
|
if File.exist?(config_path)
|
146
147
|
@config = YAML.load(File.read(config_path)) || {}
|
147
148
|
else
|
@@ -149,6 +150,16 @@ module MotionProvisioning
|
|
149
150
|
end
|
150
151
|
end
|
151
152
|
|
153
|
+
def self.output_path=(path)
|
154
|
+
path = File.expand_path(path)
|
155
|
+
Utils.log('Info', "Output directory for MotionProvisioning set to '#{path}'.")
|
156
|
+
@output_path = path
|
157
|
+
end
|
158
|
+
|
159
|
+
def self.output_path
|
160
|
+
@output_path ||= File.expand_path('provisioning')
|
161
|
+
end
|
162
|
+
|
152
163
|
def self.services
|
153
164
|
@services ||= []
|
154
165
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: motion-provisioning
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Villacampa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: spaceship
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.37.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.37.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|