cert 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/cert +1 -1
- data/lib/cert.rb +1 -2
- data/lib/cert/cert_runner.rb +4 -2
- data/lib/cert/dependency_checker.rb +2 -2
- data/lib/cert/keychain_importer.rb +3 -3
- data/lib/cert/options.rb +6 -6
- data/lib/cert/version.rb +1 -1
- metadata +4 -5
- data/lib/cert/signing_request.rb +0 -37
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88229cf680a91240aeed1791a54e568a13549a11
|
4
|
+
data.tar.gz: 5acd569ede0bf47bbd5c52f0bc9f755477653367
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68bd433d9523547edcbe31eef175fdf543d8744c411bc7e55d4974bd34f7ef628c590faa6f497a9b7b3f03f719e7923cc541b5b0e9970dcf37cb7ebd166ac61a
|
7
|
+
data.tar.gz: 7c714f5d69ba69d19f19dcc2cee018c31b6cfc091219b0152b66e235fa610349daf776e932a0e1b474ece109c92ba8f034005cf910b8864108d63e49c8e12594
|
data/bin/cert
CHANGED
data/lib/cert.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'cert/version'
|
2
2
|
require 'cert/dependency_checker'
|
3
3
|
require 'cert/cert_runner'
|
4
|
-
require 'cert/signing_request'
|
5
4
|
require 'cert/keychain_importer'
|
6
5
|
|
7
6
|
require 'fastlane_core'
|
@@ -12,7 +11,7 @@ module Cert
|
|
12
11
|
class << self
|
13
12
|
attr_accessor :config
|
14
13
|
end
|
15
|
-
|
14
|
+
|
16
15
|
TMP_FOLDER = "/tmp/cert/"
|
17
16
|
FileUtils.mkdir_p TMP_FOLDER
|
18
17
|
|
data/lib/cert/cert_runner.rb
CHANGED
@@ -3,11 +3,13 @@ module Cert
|
|
3
3
|
def launch
|
4
4
|
run
|
5
5
|
|
6
|
-
installed = FastlaneCore::CertChecker.installed?ENV["CER_FILE_PATH"]
|
6
|
+
installed = FastlaneCore::CertChecker.installed? ENV["CER_FILE_PATH"]
|
7
7
|
raise "Could not find the newly generated certificate installed" unless installed
|
8
8
|
end
|
9
9
|
|
10
10
|
def run
|
11
|
+
FastlaneCore::PrintTable.print_values(config: Cert.config, hide_keys: [], title: "Summary")
|
12
|
+
|
11
13
|
Helper.log.info "Starting login with user '#{Cert.config[:username]}'"
|
12
14
|
Spaceship.login(Cert.config[:username], nil)
|
13
15
|
Spaceship.select_team
|
@@ -28,7 +30,7 @@ module Cert
|
|
28
30
|
certificates.each do |certificate|
|
29
31
|
path = store_certificate(certificate)
|
30
32
|
|
31
|
-
if FastlaneCore::CertChecker.installed?path
|
33
|
+
if FastlaneCore::CertChecker.installed? path
|
32
34
|
# This certificate is installed on the local machine
|
33
35
|
ENV["CER_CERTIFICATE_ID"] = certificate.id
|
34
36
|
ENV["CER_FILE_PATH"] = path
|
@@ -6,7 +6,7 @@ module Cert
|
|
6
6
|
|
7
7
|
def self.check_xcode_select
|
8
8
|
return if Helper.is_test?
|
9
|
-
unless `xcode-select -v`.include?"xcode-select version "
|
9
|
+
unless `xcode-select -v`.include? "xcode-select version "
|
10
10
|
Helper.log.fatal '#############################################################'
|
11
11
|
Helper.log.fatal "# You have to install the Xcode commdand line tools to use cert"
|
12
12
|
Helper.log.fatal "# Install the latest version of Xcode from the AppStore"
|
@@ -16,4 +16,4 @@ module Cert
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
19
|
-
end
|
19
|
+
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
module Cert
|
2
2
|
class KeychainImporter
|
3
3
|
def self.import_file(path)
|
4
|
-
raise "Could not find file '#{path}'".red unless File.
|
4
|
+
raise "Could not find file '#{path}'".red unless File.exist?(path)
|
5
5
|
keychain = Cert.config[:keychain_path] || "#{Dir.home}/Library/Keychains/login.keychain"
|
6
|
-
|
6
|
+
|
7
7
|
puts `security import '#{path}' -k '#{keychain}'`
|
8
8
|
end
|
9
9
|
end
|
10
|
-
end
|
10
|
+
end
|
data/lib/cert/options.rb
CHANGED
@@ -19,8 +19,8 @@ module Cert
|
|
19
19
|
env_name: "CERT_TEAM_ID",
|
20
20
|
description: "The ID of your team if you're in multiple teams",
|
21
21
|
optional: true,
|
22
|
-
verify_block:
|
23
|
-
|
22
|
+
verify_block: proc do |value|
|
23
|
+
ENV["FASTLANE_TEAM_ID"] = value
|
24
24
|
end),
|
25
25
|
FastlaneCore::ConfigItem.new(key: :output_path,
|
26
26
|
short_option: "-o",
|
@@ -32,16 +32,16 @@ module Cert
|
|
32
32
|
env_name: "CERT_KEYCHAIN_PATH",
|
33
33
|
description: "Path to a custom keychain",
|
34
34
|
optional: true,
|
35
|
-
verify_block:
|
36
|
-
|
35
|
+
verify_block: proc do |value|
|
36
|
+
raise "Keychain not found at path '#{value}'".red unless File.exist? value
|
37
37
|
end),
|
38
38
|
FastlaneCore::ConfigItem.new(key: :signing_request_path,
|
39
39
|
short_option: "-s",
|
40
40
|
env_name: "CERT_SIGNING_REQUEST_PATH",
|
41
41
|
description: "Path to a signing request file (optional)",
|
42
42
|
optional: true,
|
43
|
-
verify_block:
|
44
|
-
|
43
|
+
verify_block: proc do |value|
|
44
|
+
raise "File not found at path '#{value}'".red unless File.exist? value
|
45
45
|
end)
|
46
46
|
]
|
47
47
|
end
|
data/lib/cert/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cert
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Felix Krause
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fastlane_core
|
@@ -16,7 +16,7 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.19.0
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: 1.0.0
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 0.
|
29
|
+
version: 0.19.0
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 1.0.0
|
@@ -144,7 +144,6 @@ files:
|
|
144
144
|
- lib/cert/dependency_checker.rb
|
145
145
|
- lib/cert/keychain_importer.rb
|
146
146
|
- lib/cert/options.rb
|
147
|
-
- lib/cert/signing_request.rb
|
148
147
|
- lib/cert/version.rb
|
149
148
|
homepage: https://fastlane.tools
|
150
149
|
licenses:
|
data/lib/cert/signing_request.rb
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
require 'openssl'
|
2
|
-
|
3
|
-
module Cert
|
4
|
-
class SigningRequest
|
5
|
-
def self.get_path
|
6
|
-
return Cert.config[:signing_request_path] if Cert.config[:signing_request_path]
|
7
|
-
|
8
|
-
self.generate
|
9
|
-
end
|
10
|
-
|
11
|
-
def self.generate
|
12
|
-
Helper.log.info "Creating a signing certificate for you.".green
|
13
|
-
key = OpenSSL::PKey::RSA.new 2048
|
14
|
-
|
15
|
-
# Generate CSR
|
16
|
-
csr = OpenSSL::X509::Request.new
|
17
|
-
csr.version = 0
|
18
|
-
csr.subject = OpenSSL::X509::Name.new([
|
19
|
-
['CN', "PEM", OpenSSL::ASN1::UTF8STRING]
|
20
|
-
])
|
21
|
-
csr.public_key = key.public_key
|
22
|
-
csr.sign key, OpenSSL::Digest::SHA1.new
|
23
|
-
|
24
|
-
path = File.join(TMP_FOLDER, 'CertCertificateSigningRequest.certSigningRequest')
|
25
|
-
private_key_path = File.join(TMP_FOLDER, 'private_key.p12')
|
26
|
-
File.write(path, csr.to_pem)
|
27
|
-
File.write(private_key_path, key)
|
28
|
-
|
29
|
-
# Import the private key into the Keychain
|
30
|
-
puts `chmod 600 '#{private_key_path}'` # otherwise we're not allowed to import the private key
|
31
|
-
KeychainImporter.import_file(private_key_path)
|
32
|
-
|
33
|
-
Helper.log.info "Successfully generated .certSigningRequest at path '#{path}'".green
|
34
|
-
return path
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|