Last active
July 21, 2020 17:29
-
-
Save FranzBusch/35778fabb90d704219335007dce9456b to your computer and use it in GitHub Desktop.
Sixt CI Certificates lane
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
####### Certificates ####### | |
desc "Installs the certificates and profiles locally" | |
lane :certificates do |options| | |
if options[:use_temporary_keychain] | |
create_temporary_keychain | |
end | |
readonly = (options[:refresh_certificates] ? false : true) | |
force_for_new_devices = !readonly | |
match( | |
git_branch: "Company-Enterprise", | |
app_identifier: "com.sixt.MediumTest-dev", | |
team_id: "XXX", | |
type: "development", | |
readonly: readonly, | |
force_for_new_devices: force_for_new_devices | |
) | |
match( | |
git_branch: "Company", | |
app_identifier: "com.sixt.MediumTest", | |
team_id: "XXX", | |
type: "appstore", | |
readonly: readonly | |
) | |
match( | |
git_branch: "Company-Enterprise", | |
app_identifier: "com.sixt.MediumTest-alpha", | |
team_id: "XXX", | |
type: "enterprise", | |
readonly: readonly | |
) | |
if options[:use_temporary_keychain] | |
sh "security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k #{ENV["KEYCHAIN_NAME"]} #{ENV["KEYCHAIN_PASSWORD"]}" | |
end | |
end | |
private_lane :create_temporary_keychain do | |
keychain_name = "temporary_keychain" | |
ENV["KEYCHAIN_NAME"] = keychain_name | |
ENV["KEYCHAIN_PASSWORD"] = keychain_name | |
ENV["MATCH_KEYCHAIN_NAME"] = keychain_name | |
ENV["MATCH_KEYCHAIN_PASSWORD"] = keychain_name | |
create_keychain( | |
default_keychain: true, | |
unlock: true, | |
timeout: 3600, | |
add_to_search_list: true | |
) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment