Class: Fastlane::Actions::ImportCertificateAction

Inherits:
Fastlane::Action show all
Defined in:
lib/fastlane/actions/import_certificate.rb

Class Method Summary collapse

Methods inherited from Fastlane::Action

action_name, author, details, output, sh, step_text

Class Method Details

.authorsObject


36
37
38
# File 'lib/fastlane/actions/import_certificate.rb', line 36

def self.authors
  ["gin0606"]
end

.available_optionsObject


19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/fastlane/actions/import_certificate.rb', line 19

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :keychain_name,
                                 env_name: "KEYCHAIN_NAME",
                                 description: "Keychain name into which item",
                                 optional: false),
    FastlaneCore::ConfigItem.new(key: :certificate_path,
                                 env_name: "",
                                 description: "Path to certificate",
                                 optional: false),
    FastlaneCore::ConfigItem.new(key: :certificate_password,
                                 env_name: "",
                                 description: "Certificate password",
                                 optional: true),
  ]
end

.descriptionObject


15
16
17
# File 'lib/fastlane/actions/import_certificate.rb', line 15

def self.description
  "Import certificate from inputfile into a keychain"
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)

40
41
42
# File 'lib/fastlane/actions/import_certificate.rb', line 40

def self.is_supported?(platform)
  true
end

.run(params) ⇒ Object


6
7
8
9
10
11
12
13
# File 'lib/fastlane/actions/import_certificate.rb', line 6

def self.run(params)
  command = "security import #{params[:certificate_path].shellescape} -k ~/Library/Keychains/#{params[:keychain_name].shellescape}"
  command << " -P #{params[:certificate_password].shellescape}" if params[:certificate_password]
  command << " -T /usr/bin/codesign"
  command << " -T /usr/bin/security"

  Fastlane::Actions.sh command, log: false
end