#!/usr/bin/env groovy pipeline { agent { label 'MAC' } environment { PATH = "$HOME/.rbenv/shims:$PATH" } parameters { gitParameter defaultValue: 'origin/master', name: 'gitBranch', type: 'BRANCH', description: 'Select the branch you want to build e.g. origin/master.' password name: 'CI_PASSWORD', description: '' password name: 'FASTLANE_SESSION', description: '' password name: 'FIREBASE_API_KEY', description: '' password name: 'FIREBASE_GOOGLE_APP_ID', description: '' } options { timeout(time: 2, unit: 'HOURS') timestamps() buildDiscarder(logRotator(numToKeepStr: '30', artifactNumToKeepStr: '30')) } stages { stage('Prepare') { steps { withCredentials([usernamePassword(credentialsId: '29a4006b-0d8b-4fe9-9237-b00856bdb0de', passwordVariable: 'PASSWORD', usernameVariable: 'USERNAME')]) { script { unlockMACKeychain "${PASSWORD}" } } sh 'cd src && bundle install' } } stage('Release') { steps { sh 'cd src && bundle exec fastlane ios release' } } } post { always { // clean workspace deleteDir() } } }