pipeline { agent { label 'macos' } options { buildDiscarder(logRotator( numToKeepStr: '20', daysToKeepStr: '30', artifactNumToKeepStr: '10', )) } environment { LANG = 'en_US.UTF-8' LANGUAGE = 'en_US.UTF-8' LC_ALL = 'en_US.UTF-8' FASTLANE_DISABLE_COLORS = 1 REALM_DISABLE_ANALYTICS = 1 ANDROID_HOME = '/usr/local/share/android-sdk' ANDROID_SDK_ROOT = '/usr/local/share/android-sdk' ANDROID_NDK = '/Users/jenkins/android-ndk-r10e' ANDROID_NDK_HOME = '/Users/jenkins/android-ndk-r10e' } stages { stage('Prep') { steps { script { print "Running ${params.BUILD_TYPE} build!" /* Necessary to load methods */ mobile = load 'ci/mobile.groovy' mobile.prep(params.BUILD_TYPE) } } } stage('Lint') { steps { script { mobile.runLint() } } } stage('Tests') { steps { script { mobile.runTests() } } } stage('Build') { steps { script { mobile.leinBuild() } } } stage('Compile') { steps { script { apk = mobile.android.compile(params.BUILD_TYPE) } } } stage('Archive') { steps { script { archiveArtifacts apk } } } stage('Upload') { steps { script { switch (params.BUILD_TYPE) { case 'release': mobile.android.uploadToPlayStore(); break; case 'nightly': env.DIAWI_URL = mobile.android.uploadToDiawi() case 'e2e': e2eApk = mobile.android.uploadToSauceLabs() } } } } stage('Run e2e') { when { expression { params.BUILD_TYPE == 'e2e' } } steps { script { build( job: 'end-to-end-tests/status-app-nightly', wait: false, parameters: [string(name: 'apk', value: "--apk=${e2eApk}")] ) } } } } }