cert 1.2.1 → 1.2.2
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 +4 -4
- data/lib/cert/keychain_importer.rb +1 -1
- data/lib/cert/options.rb +1 -0
- data/lib/cert/runner.rb +18 -2
- data/lib/cert/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5dc672f91a984de666467e09292a3b33f43932cb
|
4
|
+
data.tar.gz: 7897eb987cb577b8d7714dd32dca080290183b10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86b735f69ae660166565c260f69bafcabb130c3b2463b35e24b5db9e9623b208bea9d44294a451f97e24096570cdf7cea235ea73fa33c11d73cb033fd13971b9
|
7
|
+
data.tar.gz: 175cf3b8f3bd4bacc3427c898cdbfd5a3c6c33758aa7caf32183d87dd297077bfc77c4f7cb2cc21377358fbed8c97021c2fed789b320dadabccdaac6bc5bb90d
|
@@ -2,7 +2,7 @@ module Cert
|
|
2
2
|
class KeychainImporter
|
3
3
|
def self.import_file(path)
|
4
4
|
raise "Could not find file '#{path}'".red unless File.exist?(path)
|
5
|
-
keychain = Cert.config[:keychain_path] || "#{Dir.home}/Library/Keychains/login.keychain"
|
5
|
+
keychain = File.expand_path(Cert.config[:keychain_path]) || "#{Dir.home}/Library/Keychains/login.keychain"
|
6
6
|
|
7
7
|
command = "security import #{path.shellescape} -k '#{keychain}'"
|
8
8
|
command << " -T /usr/bin/codesign" # to not be asked for permission when running a tool like `gym`
|
data/lib/cert/options.rb
CHANGED
data/lib/cert/runner.rb
CHANGED
@@ -32,6 +32,7 @@ module Cert
|
|
32
32
|
def find_existing_cert
|
33
33
|
certificates.each do |certificate|
|
34
34
|
path = store_certificate(certificate)
|
35
|
+
private_key_path = File.expand_path(File.join(Cert.config[:output_path], "#{certificate.id}.p12"))
|
35
36
|
|
36
37
|
if FastlaneCore::CertChecker.installed?(path)
|
37
38
|
# This certificate is installed on the local machine
|
@@ -41,6 +42,18 @@ module Cert
|
|
41
42
|
Helper.log.info "Found the certificate #{certificate.id} (#{certificate.name}) which is installed on the local machine. Using this one.".green
|
42
43
|
|
43
44
|
return path
|
45
|
+
|
46
|
+
elsif File.exist?(private_key_path)
|
47
|
+
KeychainImporter.import_file(private_key_path)
|
48
|
+
KeychainImporter.import_file(path)
|
49
|
+
|
50
|
+
ENV["CER_CERTIFICATE_ID"] = certificate.id
|
51
|
+
ENV["CER_FILE_PATH"] = path
|
52
|
+
|
53
|
+
Helper.log.info "Found the cached certificate #{certificate.id} (#{certificate.name}). Using this one.".green
|
54
|
+
|
55
|
+
return path
|
56
|
+
|
44
57
|
else
|
45
58
|
Helper.log.info "Certificate #{certificate.id} (#{certificate.name}) can't be found on your local computer"
|
46
59
|
end
|
@@ -77,10 +90,13 @@ module Cert
|
|
77
90
|
end
|
78
91
|
|
79
92
|
# Store all that onto the filesystem
|
80
|
-
|
93
|
+
|
94
|
+
request_path = File.expand_path(File.join(Cert.config[:output_path], "#{certificate.id}.certSigningRequest"))
|
81
95
|
File.write(request_path, csr.to_pem)
|
82
|
-
|
96
|
+
|
97
|
+
private_key_path = File.expand_path(File.join(Cert.config[:output_path], "#{certificate.id}.p12"))
|
83
98
|
File.write(private_key_path, pkey)
|
99
|
+
|
84
100
|
cert_path = store_certificate(certificate)
|
85
101
|
|
86
102
|
# Import all the things into the Keychain
|
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: 1.2.
|
4
|
+
version: 1.2.2
|
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-
|
11
|
+
date: 2015-11-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fastlane_core
|