cert 1.2.1 → 1.2.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: 4cf06826d22f982778a2740de18028d20f1ed45a
4
- data.tar.gz: c817719c45e235a5d363c864c1a5902a74ca0cec
3
+ metadata.gz: 5dc672f91a984de666467e09292a3b33f43932cb
4
+ data.tar.gz: 7897eb987cb577b8d7714dd32dca080290183b10
5
5
  SHA512:
6
- metadata.gz: 9ae9c75fbef4ed61babe5a89f8e99162f0a06584fd6c9cdd26e3c8f5f47bac1abe43ab314fa53fda23e1385a24b9d7f44a2c427c46f9c45cc7f32ea5099c75e4
7
- data.tar.gz: cf7b0442742228c23d9f4d1e2ea9aad7fa89661020ab6113f18c006f56c842159eaec41129b32a1af2bdb95c9c7f1ef07d7b3eebe0d5c9f8260832e1af13c2a8
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
@@ -49,6 +49,7 @@ module Cert
49
49
  description: "Path to a custom keychain",
50
50
  optional: true,
51
51
  verify_block: proc do |value|
52
+ value = File.expand_path(value)
52
53
  raise "Keychain not found at path '#{value}'".red unless File.exist? value
53
54
  end)
54
55
  ]
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
- request_path = File.expand_path(File.join(Cert.config[:output_path], 'CertCertificateSigningRequest.certSigningRequest'))
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
- private_key_path = File.expand_path(File.join(Cert.config[:output_path], 'private_key.p12'))
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
@@ -1,3 +1,3 @@
1
1
  module Cert
2
- VERSION = "1.2.1"
2
+ VERSION = "1.2.2"
3
3
  end
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.1
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-08 00:00:00.000000000 Z
11
+ date: 2015-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fastlane_core