fastlane/lib/fastlane/actions/setup_ci.rb in fastlane-2.205.2 vs fastlane/lib/fastlane/actions/setup_ci.rb in fastlane-2.206.0
- old
+ new
@@ -10,22 +10,22 @@
case detect_provider(params)
when 'circleci'
setup_output_paths
end
- setup_keychain
+ setup_keychain(params)
end
def self.should_run?(params)
Helper.ci? || params[:force]
end
def self.detect_provider(params)
params[:provider] || (Helper.is_circle_ci? ? 'circleci' : nil)
end
- def self.setup_keychain
+ def self.setup_keychain(params)
unless Helper.mac?
UI.message("Skipping Keychain setup on non-macOS CI Agent")
return
end
@@ -41,11 +41,11 @@
UI.message("Creating temporary keychain: \"#{keychain_name}\".")
Actions::CreateKeychainAction.run(
name: keychain_name,
default_keychain: true,
unlock: true,
- timeout: 3600,
+ timeout: params[:timeout],
lock_when_sleeps: true,
password: "",
add_to_search_list: true
)
@@ -101,11 +101,16 @@
verify_block: proc do |value|
value = value.to_s
# Validate both 'travis' and 'circleci' for backwards compatibility, even
# though only the latter receives special treatment by this action
UI.user_error!("A given CI provider '#{value}' is not supported. Available CI providers: 'travis', 'circleci'") unless ["travis", "circleci"].include?(value)
- end)
+ end),
+ FastlaneCore::ConfigItem.new(key: :timeout,
+ env_name: "FL_SETUP_CI_TIMEOUT",
+ description: "Set a custom timeout in seconds for keychain. Set `0` if you want to specify 'no time-out'",
+ type: Integer,
+ default_value: 3600)
]
end
def self.authors
["mollyIV", "svenmuennich"]
@@ -117,9 +122,13 @@
def self.example_code
[
'setup_ci(
provider: "circleci"
+ )',
+ 'setup_ci(
+ provider: "circleci",
+ timeout: 0
)'
]
end
def self.category