Last active
September 10, 2020 10:53
-
-
Save elenipapanik/d13e1f6949d4f8891beae4558ab6cb02 to your computer and use it in GitHub Desktop.
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
def deployWith(bundle_id, configuration, provisioning_profile) { | |
stage('Checkout') { | |
checkout scm | |
} | |
stage('Install dependencies') { | |
sh 'gem install bundler' | |
sh 'bundle update' | |
sh 'bundle exec pod repo update' | |
sh 'bundle exec pod install' | |
} | |
stage('Reset Simulators') { | |
sh 'bundle exec fastlane snapshot reset_simulators --force' | |
} | |
stage('Run Tests') { | |
sh 'bundle exec fastlane test configuration:$configuration' | |
} | |
stage('Build') { | |
withEnv(["FASTLANE_USER=fastlane_user_email_address"]) { | |
withCredentials([ | |
string([ | |
credentialsId:'match_password_id', | |
variable: 'MATCH_PASSWORD' | |
]), | |
string([ | |
credentialsId: 'fastlane_password_id', | |
variable: 'FASTLANE_PASSWORD']), | |
]) { | |
sh 'bundle exec fastlane build bundle_id:$bundle_id configuration:$configuration provisioning_profile:$provisioning_profile' | |
} | |
} | |
} | |
stage('Upload to TestFlight') { | |
withEnv(["FASTLANE_USER=fastlane_user_email_address"]) { | |
withCredentials([ | |
string([ | |
credentialsId: 'fastlane_password_id', | |
variable: 'FASTLANE_PASSWORD']), | |
]) { | |
sh "bundle exec fastlane upload_to_testflight bundle_id:$bundle_id" | |
} | |
} | |
} | |
stage('Cleanup') { | |
cleanWs notFailBuild: true | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment