Last active
April 25, 2018 17:07
-
-
Save acecilia/5c7755b7418bb7a6c68affb9f1164dc3 to your computer and use it in GitHub Desktop.
Fastlane match with keychain removal
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
# If the match keychain is present, remove it | |
def remove_keychain_if_exists | |
delete_keychain(name: <keychainName>) if File.exist? File.expand_path "~/Library/Keychains/#{<keychainName>}-db" # The File.expand_path is crutial, otherwise File.exist? will not work!!!!!!! | |
end | |
keychainPassword = SecureRandom.base64(16) # We need a key for the keychain, so nobody can extract the certificates out while the build is happening | |
remove_keychain_if_exists | |
create_keychain( | |
name: <keychainName>, | |
password: keychainPassword, | |
unlock: true, | |
timeout: false | |
) | |
match( | |
username: <username>, | |
app_identifier: <app_identifier>, | |
type: <type>, | |
shallow_clone: true, | |
clone_branch_directly: true, | |
verbose: true, | |
keychain_name: <keychainName>, | |
keychain_password: keychainPassword | |
) | |
gym( | |
scheme: <schemeName>, | |
configuration: <conf>, | |
clean: true, | |
export_method: <export_method>, | |
export_team_id: <username> | |
) | |
remove_keychain_if_exists |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment