Class: Fastlane::Actions::SyncDevicesAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::SyncDevicesAction
- Includes:
- Helper::SyncDevicesHelper
- Defined in:
- lib/fastlane/plugin/sync_devices/actions/sync_devices_action.rb
Overview
Fastlane action to synchronize remote devices on Apple Developer Portal with local devices file.
Class Method Summary collapse
-
.authors ⇒ Array<String>
Authors of this plugin.
-
.available_options ⇒ Array<FastlaneCore::ConfigItem>
Available options of this plugin.
-
.category ⇒ Symbol
Category of this plugin.
-
.description ⇒ String
Description of this plugin.
-
.details ⇒ String
Detailed description of this plugin.
-
.example_code ⇒ Array<String>
Example usages of this plugin.
-
.is_supported?(_platform) ⇒ true
Whether if this plugin is supported on the platform.
-
.run(params) ⇒ void
The main entry point of this plugin.
Class Method Details
.authors ⇒ Array<String>
Authors of this plugin.
77 78 79 |
# File 'lib/fastlane/plugin/sync_devices/actions/sync_devices_action.rb', line 77 def self. ['Ryosuke Ito'] end |
.available_options ⇒ Array<FastlaneCore::ConfigItem>
Available options of this plugin.
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 |
# File 'lib/fastlane/plugin/sync_devices/actions/sync_devices_action.rb', line 101 def self. # rubocop:disable Metrics/AbcSize, Metrics/MethodLength [ FastlaneCore::ConfigItem.new( key: :dry_run, env_name: 'FL_SYNC_DEVICES_DRY_RUN', description: 'Do not modify the registered devices but just print what will be done', type: Boolean, default_value: false, optional: true ), FastlaneCore::ConfigItem.new( key: :devices_file, env_name: 'FL_SYNC_DEVICES_FILE', description: 'Provide a path to a file with the devices to register. ' \ 'For the format of the file see the examples', optional: true, verify_block: proc do |value| UI.user_error!("Could not find file '#{value}'") unless File.exist?(value) end ), FastlaneCore::ConfigItem.new( key: :api_key_path, env_names: %w[FL_SYNC_DEVICES_API_KEY_PATH APP_STORE_CONNECT_API_KEY_PATH], description: 'Path to your App Store Connect API Key JSON file ' \ '(https://docs.fastlane.tools/app-store-connect-api/#using-fastlane-api-key-json-file)', optional: true, conflicting_options: [:api_key], verify_block: proc do |value| UI.user_error!("Couldn't find API key JSON file at path '#{value}'") unless File.exist?(value) end ), FastlaneCore::ConfigItem.new( key: :api_key, env_names: %w[FL_SYNC_DEVICES_API_KEY APP_STORE_CONNECT_API_KEY], description: 'Your App Store Connect API Key information ' \ '(https://docs.fastlane.tools/app-store-connect-api/#using-fastlane-api-key-hash-option)', type: Hash, default_value: Fastlane::Actions.lane_context[Fastlane::Actions::SharedValues::APP_STORE_CONNECT_API_KEY], default_value_dynamic: true, optional: true, sensitive: true, conflicting_options: [:api_key_path] ), FastlaneCore::ConfigItem.new( key: :team_id, env_name: 'SYNC_DEVICES_TEAM_ID', code_gen_sensitive: true, default_value: CredentialsManager::AppfileConfig.try_fetch_value(:team_id), default_value_dynamic: true, description: "The ID of your Developer Portal team if you're in multiple teams", optional: true, verify_block: proc do |value| ENV['FASTLANE_TEAM_ID'] = value.to_s end ), FastlaneCore::ConfigItem.new( key: :team_name, env_name: 'SYNC_DEVICES_TEAM_NAME', description: "The name of your Developer Portal team if you're in multiple teams", optional: true, code_gen_sensitive: true, default_value: CredentialsManager::AppfileConfig.try_fetch_value(:team_name), default_value_dynamic: true, verify_block: proc do |value| ENV['FASTLANE_TEAM_NAME'] = value.to_s end ), FastlaneCore::ConfigItem.new( key: :username, env_name: 'DELIVER_USER', description: 'Optional: Your Apple ID', optional: true, default_value: CredentialsManager::AppfileConfig.try_fetch_value(:apple_id), default_value_dynamic: true ) ] end |
.category ⇒ Symbol
Category of this plugin.
217 218 219 |
# File 'lib/fastlane/plugin/sync_devices/actions/sync_devices_action.rb', line 217 def self.category :code_signing end |
.description ⇒ String
Description of this plugin.
69 70 71 |
# File 'lib/fastlane/plugin/sync_devices/actions/sync_devices_action.rb', line 69 def self.description 'Synchronize your devices with Apple Developer Portal.' end |
.details ⇒ String
Detailed description of this plugin.
85 86 87 88 89 90 91 92 93 |
# File 'lib/fastlane/plugin/sync_devices/actions/sync_devices_action.rb', line 85 def self.details <<~DETAILS This will synchronize iOS/Mac devices with the Apple Developer Portal so that you can include them in your provisioning profiles. Unlike `register_devices` action, this action may disable, enable or rename devices. Maybe it sounds dangerous but actually it does not delete anything, so you can recover the changes by yourself if needed. The action will connect to the Apple Developer Portal using AppStore Connect API. DETAILS end |
.example_code ⇒ Array<String>
Example usages of this plugin.
192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 |
# File 'lib/fastlane/plugin/sync_devices/actions/sync_devices_action.rb', line 192 def self.example_code [ <<~EX_1, <<~EX_2, <<~EX_3 # Just check what will occur sync_devices(devices_file: '/path/to/devices.txt', dry_run: true) EX_3 ] end |
.is_supported?(_platform) ⇒ true
Whether if this plugin is supported on the platform.
184 185 186 |
# File 'lib/fastlane/plugin/sync_devices/actions/sync_devices_action.rb', line 184 def self.is_supported?(_platform) # rubocop:disable Naming/PredicateName true end |
.run(params) ⇒ void
This method returns an undefined value.
The main entry point of this plugin.
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/fastlane/plugin/sync_devices/actions/sync_devices_action.rb', line 29 def self.run(params) require 'spaceship/connect_api' devices_file = params[:devices_file] UI.user_error!('You must pass `devices_file`. Please check the readme.') unless devices_file spaceship_login(params) new_devices = DevicesFile.load(devices_file) UI.('Fetching list of currently registered devices...') current_devices = Spaceship::ConnectAPI::Device.all patch = DevicesPatch.new(current_devices, new_devices) patch.apply!(dry_run: params[:dry_run]) UI.success('Successfully synchronized devices.') end |