Compare commits
1 Commits
master
...
feature/ap
| Author | SHA1 | Date |
|---|---|---|
|
|
f5885f435d |
|
|
@ -374,11 +374,8 @@ end
|
||||||
def fill_up_options_using_configuration_type(options, configuration_type)
|
def fill_up_options_using_configuration_type(options, configuration_type)
|
||||||
configuration = get_configuration_for_type(configuration_type.type)
|
configuration = get_configuration_for_type(configuration_type.type)
|
||||||
|
|
||||||
api_key_json_path = File.expand_path "../fastlane/#{configuration_type.prefix}_api_key.json"
|
api_key_path = File.expand_path "../fastlane/#{configuration_type.prefix}_api_key.json"
|
||||||
is_api_key_file_exists = File.exists?(api_key_json_path)
|
is_api_key_file_exists = File.exists?(api_key_path)
|
||||||
|
|
||||||
api_key_path = nil
|
|
||||||
api_key = nil
|
|
||||||
|
|
||||||
# Check whether configuration type is required to configure one of api key parameters or not
|
# Check whether configuration type is required to configure one of api key parameters or not
|
||||||
|
|
||||||
|
|
@ -389,40 +386,38 @@ def fill_up_options_using_configuration_type(options, configuration_type)
|
||||||
if is_api_key_file_exists
|
if is_api_key_file_exists
|
||||||
|
|
||||||
# If exists then fill in all required information through api_key_path parameter
|
# If exists then fill in all required information through api_key_path parameter
|
||||||
|
# and set a value to an options` parameter respectively
|
||||||
|
|
||||||
api_key_path = "fastlane/#{configuration_type.prefix}_api_key.json"
|
default_options = {:api_key_path => api_key_path}
|
||||||
else
|
else
|
||||||
|
|
||||||
require 'json'
|
|
||||||
|
|
||||||
# If doesn't exist then build api_key parameter through app_store_connect_api_key action
|
# If doesn't exist then build api_key parameter through app_store_connect_api_key action
|
||||||
|
# and set a value to an options` parameter respectively also
|
||||||
|
|
||||||
api_key_parameters = JSON.parse(ENV['API_KEY_JSON'])
|
default_options = {:api_key => get_app_store_connect_api_key()}
|
||||||
|
|
||||||
api_key = app_store_connect_api_key(
|
|
||||||
key_id: api_key_parameters['key_id'],
|
|
||||||
issuer_id: api_key_parameters['issuer_id'],
|
|
||||||
key_content: api_key_parameters['key'],
|
|
||||||
duration: api_key_parameters['duration'],
|
|
||||||
in_house: api_key_parameters['in_house']
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Setting required parameter depending on API key JSON file existence
|
|
||||||
|
|
||||||
if is_api_key_file_exists
|
|
||||||
default_options = {:api_key_path => api_key_path}
|
|
||||||
else
|
|
||||||
default_options = {:api_key => api_key}
|
|
||||||
end
|
|
||||||
|
|
||||||
default_options
|
default_options
|
||||||
.merge(configuration.to_options)
|
.merge(configuration.to_options)
|
||||||
.merge(get_keychain_options(options))
|
.merge(get_keychain_options(options))
|
||||||
.merge(options)
|
.merge(options)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def get_app_store_connect_api_key()
|
||||||
|
require 'json'
|
||||||
|
|
||||||
|
api_key_parameters = JSON.parse(ENV['API_KEY_JSON'])
|
||||||
|
|
||||||
|
return app_store_connect_api_key(
|
||||||
|
key_id: api_key_parameters['key_id'],
|
||||||
|
issuer_id: api_key_parameters['issuer_id'],
|
||||||
|
key_content: api_key_parameters['key'],
|
||||||
|
duration: api_key_parameters['duration'],
|
||||||
|
in_house: api_key_parameters['in_house']
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
def get_keychain_options(options)
|
def get_keychain_options(options)
|
||||||
keychain_name = options[:keychain_name]
|
keychain_name = options[:keychain_name]
|
||||||
keychain_password = options[:keychain_password]
|
keychain_password = options[:keychain_password]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue