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

Class Method Details

.authorsObject



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

def self.authors
  ["gin0606"]
end

.available_optionsObject



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

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



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

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

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


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

def self.is_supported?(platform)
  true
end

.run(params) ⇒ Object



6
7
8
9
10
11
12
# 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"

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