2018-08-14 18:09:52 +00:00
|
|
|
pipeline {
|
|
|
|
agent { label 'macos' }
|
|
|
|
|
|
|
|
options {
|
|
|
|
buildDiscarder(logRotator(
|
2018-08-29 15:12:32 +00:00
|
|
|
numToKeepStr: '40',
|
2018-08-14 18:09:52 +00:00
|
|
|
daysToKeepStr: '30',
|
2018-08-29 15:12:32 +00:00
|
|
|
artifactNumToKeepStr: '40',
|
2018-08-14 18:09:52 +00:00
|
|
|
))
|
|
|
|
}
|
|
|
|
|
|
|
|
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 {
|
2018-08-21 15:17:25 +00:00
|
|
|
print "Running ${params.BUILD_TYPE} build!"
|
2018-08-14 18:09:52 +00:00
|
|
|
/* Necessary to load methods */
|
|
|
|
mobile = load 'ci/mobile.groovy'
|
2018-08-29 07:43:21 +00:00
|
|
|
cmn = load 'ci/common.groovy'
|
|
|
|
mobile.prep(cmn.getBuildType())
|
2018-08-14 18:09:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-08-27 15:32:54 +00:00
|
|
|
stage('Lint') {
|
|
|
|
steps {
|
|
|
|
script { mobile.runLint() }
|
|
|
|
}
|
|
|
|
}
|
2018-08-14 18:09:52 +00:00
|
|
|
stage('Tests') {
|
|
|
|
steps {
|
|
|
|
script { mobile.runTests() }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Build') {
|
|
|
|
steps {
|
2018-08-29 12:38:12 +00:00
|
|
|
script { mobile.leinBuild('android') }
|
2018-08-14 18:09:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Compile') {
|
|
|
|
steps {
|
2018-08-29 07:43:21 +00:00
|
|
|
script { apk = mobile.android.compile(cmn.getBuildType()) }
|
2018-08-14 18:09:52 +00:00
|
|
|
}
|
|
|
|
}
|
2018-08-21 15:17:25 +00:00
|
|
|
stage('Archive') {
|
2018-08-14 18:09:52 +00:00
|
|
|
steps {
|
2018-08-21 15:17:25 +00:00
|
|
|
script { archiveArtifacts apk }
|
2018-08-14 18:09:52 +00:00
|
|
|
}
|
|
|
|
}
|
2018-08-21 15:17:25 +00:00
|
|
|
stage('Upload') {
|
2018-08-14 18:09:52 +00:00
|
|
|
steps {
|
2018-08-27 15:32:54 +00:00
|
|
|
script {
|
2018-08-29 07:43:21 +00:00
|
|
|
switch (cmn.getBuildType()) {
|
2018-08-27 15:32:54 +00:00
|
|
|
case 'release':
|
|
|
|
mobile.android.uploadToPlayStore(); break;
|
|
|
|
case 'nightly':
|
2018-08-31 11:56:55 +00:00
|
|
|
env.DIAWI_URL = mobile.android.uploadToDiawi(); break;
|
2018-08-27 15:32:54 +00:00
|
|
|
case 'e2e':
|
2018-08-29 15:39:49 +00:00
|
|
|
env.SAUCE_URL = mobile.android.uploadToSauceLabs()
|
2018-08-27 15:32:54 +00:00
|
|
|
}
|
|
|
|
}
|
2018-08-14 18:09:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|