Skip to content

Instantly share code, notes, and snippets.

@elenipapanik
Last active September 10, 2020 12:07
Show Gist options
  • Save elenipapanik/bb2ea0538878ceb48798ccd26696128d to your computer and use it in GitHub Desktop.
Save elenipapanik/bb2ea0538878ceb48798ccd26696128d to your computer and use it in GitHub Desktop.
Deploy.groovy - version1
def deploy() {
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'
}
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'
}
}
}
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"
}
}
}
stage('Cleanup') {
cleanWs notFailBuild: true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment