Class: Fastlane::Actions::GetCertificatesAction

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

Direct Known Subclasses

CertAction

Constant Summary

Constants inherited from Fastlane::Action

Fastlane::Action::AVAILABLE_CATEGORIES, Fastlane::Action::RETURN_TYPES

Class Method Summary collapse

Methods inherited from Fastlane::Action

action_name, authors, deprecated_notes, lane_context, method_missing, other_action, return_type, return_value, sample_return_value, shell_out_should_use_bundle_exec?, step_text

Class Method Details

.authorObject



52
53
54
# File 'fastlane/lib/fastlane/actions/get_certificates.rb', line 52

def self.author
  "KrauseFx"
end

.available_optionsObject



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

def self.available_options
  require 'cert'
  Cert::Options.available_options
end

.categoryObject



71
72
73
# File 'fastlane/lib/fastlane/actions/get_certificates.rb', line 71

def self.category
  :code_signing
end

.descriptionObject



29
30
31
# File 'fastlane/lib/fastlane/actions/get_certificates.rb', line 29

def self.description
  "Create new iOS code signing certificates (via _cert_)"
end

.detailsObject



33
34
35
36
37
38
# File 'fastlane/lib/fastlane/actions/get_certificates.rb', line 33

def self.details
  [
    "**Important**: It is recommended to use [match](https://docs.fastlane.tools/actions/match/) according to the [codesigning.guide](https://codesigning.guide) for generating and maintaining your certificates. Use _cert_ directly only if you want full control over what's going on and know more about codesigning.",
    "Use this action to download the latest code signing identity."
  ].join("\n")
end

.example_codeObject



60
61
62
63
64
65
66
67
68
69
# File 'fastlane/lib/fastlane/actions/get_certificates.rb', line 60

def self.example_code
  [
    'get_certificates',
    'cert # alias for "get_certificates"',
    'get_certificates(
      development: true,
      username: "[email protected]"
    )'
  ]
end

.is_supported?(platform) ⇒ Boolean

Returns:



56
57
58
# File 'fastlane/lib/fastlane/actions/get_certificates.rb', line 56

def self.is_supported?(platform)
  platform == :ios
end

.outputObject



45
46
47
48
49
50
# File 'fastlane/lib/fastlane/actions/get_certificates.rb', line 45

def self.output
  [
    ['CERT_FILE_PATH', 'The path to the certificate'],
    ['CERT_CERTIFICATE_ID', 'The id of the certificate']
  ]
end

.run(params) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'fastlane/lib/fastlane/actions/get_certificates.rb', line 9

def self.run(params)
  require 'cert'

  return if Helper.test?

  begin
    Cert.config = params # we alread have the finished config

    Cert::Runner.new.launch
    cert_file_path = ENV["CER_FILE_PATH"]
    certificate_id = ENV["CER_CERTIFICATE_ID"]
    Actions.lane_context[SharedValues::CERT_FILE_PATH] = cert_file_path
    Actions.lane_context[SharedValues::CERT_CERTIFICATE_ID] = certificate_id

    UI.success("Use signing certificate '#{certificate_id}' from now on!")

    ENV["SIGH_CERTIFICATE_ID"] = certificate_id # for further use in the sigh action
  end
end