Class: Fastlane::Actions::ConnectedCertsAction

Inherits:
Action
  • Object
show all
Defined in:
lib/fastlane/plugin/connected/actions/connected_certs_action.rb

Class Method Summary collapse

Class Method Details

.authorsObject



41
42
43
# File 'lib/fastlane/plugin/connected/actions/connected_certs_action.rb', line 41

def self.authors
  ["Abgier Avraha"]
end

.available_optionsObject



54
55
56
57
58
59
60
61
# File 'lib/fastlane/plugin/connected/actions/connected_certs_action.rb', line 54

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :app_id,
                         description: "You app's bundle identifier",
                            optional: false,
                                type: String)
  ]
end

.descriptionObject



37
38
39
# File 'lib/fastlane/plugin/connected/actions/connected_certs_action.rb', line 37

def self.description
  "App Store Connect API Certificates Module"
end

.detailsObject



49
50
51
52
# File 'lib/fastlane/plugin/connected/actions/connected_certs_action.rb', line 49

def self.details
  # Optional:
  ""
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


63
64
65
# File 'lib/fastlane/plugin/connected/actions/connected_certs_action.rb', line 63

def self.is_supported?(platform)
  [:ios].include?(platform)
end

.return_valueObject



45
46
47
# File 'lib/fastlane/plugin/connected/actions/connected_certs_action.rb', line 45

def self.return_value
  # If your method provides a return value, you can describe here what it does
end

.run(params) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/fastlane/plugin/connected/actions/connected_certs_action.rb', line 8

def self.run(params)
  app_id = params.values[:app_id]

  if app_id == '*'
    UI.success("Successfully Downloaded Certificates!")
    return
  end
  app_store_connect = AppStoreConnect::Client.new

  # Download profiles
  UI.message("Downloading Provisioning Profiles for app: #{app_id}")
  profiles = Helper::CertsHelper.download_provisioning_profiles_for_app(app_store_connect, app_id)

  # Install profiles and profile certificates
  profiles.each do |profile|
    profile_name = profile['name']

    UI.message("Installing Provisioning Profile: #{profile_name}")
    installed_profile = Helper::CertsHelper.install_provisioning_profile(app_store_connect, profile)
    UI.success("Succesfully Installed Provisioning Profile: #{profile_name}")

    UI.message("Installing Certificates from Provisioning Profile: #{profile_name}")
    Helper::CertsHelper.install_certificates_from_provisioning_profile(app_store_connect, installed_profile)
    UI.success("Successfully Installed Certificates for Provisioning Profile: #{profile_name}\n")
  end

  UI.success("Action connected_certs completed successfully!")
end