2018-08-14 18:09:52 +00:00
|
|
|
pipeline {
|
2018-11-19 17:37:04 +00:00
|
|
|
agent { label 'macos' }
|
2018-08-14 18:09:52 +00:00
|
|
|
|
2018-12-11 11:00:22 +00:00
|
|
|
parameters {
|
2018-12-11 14:27:21 +00:00
|
|
|
string(
|
2018-12-11 11:00:22 +00:00
|
|
|
name: 'BUILD_TYPE',
|
2018-12-11 14:27:21 +00:00
|
|
|
description: 'Specify build type. Values: pr / e2e / nightly / release',
|
2018-12-11 11:00:22 +00:00
|
|
|
defaultValue: 'pr',
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2018-08-14 18:09:52 +00:00
|
|
|
options {
|
2018-11-13 11:58:34 +00:00
|
|
|
timestamps()
|
2018-12-11 14:27:21 +00:00
|
|
|
disableConcurrentBuilds()
|
2018-10-30 09:38:52 +00:00
|
|
|
/* Prevent Jenkins jobs from running forever */
|
2018-11-13 11:42:15 +00:00
|
|
|
timeout(time: 35, unit: 'MINUTES')
|
2018-10-30 09:38:52 +00:00
|
|
|
/* Limit builds retained */
|
2018-08-14 18:09:52 +00:00
|
|
|
buildDiscarder(logRotator(
|
2018-12-13 09:49:16 +00:00
|
|
|
numToKeepStr: '10',
|
|
|
|
daysToKeepStr: '20',
|
|
|
|
artifactNumToKeepStr: '10',
|
2018-08-14 18:09:52 +00:00
|
|
|
))
|
|
|
|
}
|
2018-09-25 17:01:48 +00:00
|
|
|
|
2018-08-14 18:09:52 +00:00
|
|
|
environment {
|
2018-11-29 15:55:36 +00:00
|
|
|
NODE_VERSION = 'v10.14.1'
|
2018-09-18 12:22:30 +00:00
|
|
|
BUILD_PLATFORM = 'ios'
|
2018-08-14 18:09:52 +00:00
|
|
|
LANG = 'en_US.UTF-8'
|
|
|
|
LANGUAGE = 'en_US.UTF-8'
|
|
|
|
LC_ALL = 'en_US.UTF-8'
|
|
|
|
FASTLANE_DISABLE_COLORS=1
|
|
|
|
REALM_DISABLE_ANALYTICS=1
|
2018-09-01 02:36:51 +00:00
|
|
|
BUNDLE_PATH = "${HOME}/.bundle"
|
2018-08-14 18:09:52 +00:00
|
|
|
}
|
2018-09-25 17:01:48 +00:00
|
|
|
|
2018-08-14 18:09:52 +00:00
|
|
|
stages {
|
|
|
|
stage('Prep') {
|
|
|
|
steps {
|
2018-11-29 15:55:36 +00:00
|
|
|
script { nvm(env.NODE_VERSION) {
|
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'
|
2018-12-11 14:27:21 +00:00
|
|
|
print "Running ${cmn.getBuildType()} build!"
|
2018-11-27 10:15:33 +00:00
|
|
|
/* Cleanup and Prep */
|
2018-08-29 07:43:21 +00:00
|
|
|
mobile.prep(cmn.getBuildType())
|
2018-11-27 10:15:33 +00:00
|
|
|
/* Run at start to void mismatched numbers */
|
|
|
|
cmn.buildNumber()
|
2018-11-29 15:55:36 +00:00
|
|
|
} }
|
2018-08-14 18:09:52 +00:00
|
|
|
}
|
|
|
|
}
|
2018-08-27 15:32:54 +00:00
|
|
|
stage('Lint') {
|
2018-11-29 15:55:36 +00:00
|
|
|
steps { nvm(env.NODE_VERSION) {
|
2018-09-25 17:01:48 +00:00
|
|
|
script { cmn.runLint() }
|
2018-11-29 15:55:36 +00:00
|
|
|
} }
|
2018-08-27 15:32:54 +00:00
|
|
|
}
|
2018-08-14 18:09:52 +00:00
|
|
|
stage('Tests') {
|
2018-11-29 15:55:36 +00:00
|
|
|
steps { nvm(env.NODE_VERSION) {
|
2018-09-25 17:01:48 +00:00
|
|
|
script { cmn.runTests() }
|
2018-11-29 15:55:36 +00:00
|
|
|
} }
|
2018-08-14 18:09:52 +00:00
|
|
|
}
|
|
|
|
stage('Build') {
|
2018-11-29 15:55:36 +00:00
|
|
|
steps { nvm(env.NODE_VERSION) {
|
2018-08-29 12:38:12 +00:00
|
|
|
script { mobile.leinBuild('ios') }
|
2018-11-29 15:55:36 +00:00
|
|
|
} }
|
2018-08-14 18:09:52 +00:00
|
|
|
}
|
2018-12-06 10:52:44 +00:00
|
|
|
stage('Bundle') {
|
2018-11-29 15:55:36 +00:00
|
|
|
steps { nvm(env.NODE_VERSION) {
|
2018-12-06 10:52:44 +00:00
|
|
|
script { api = mobile.ios.bundle(cmn.getBuildType()) }
|
2018-11-29 15:55:36 +00:00
|
|
|
} }
|
2018-08-14 18:09:52 +00:00
|
|
|
}
|
|
|
|
stage('Archive') {
|
|
|
|
steps {
|
2018-12-11 14:27:21 +00:00
|
|
|
archiveArtifacts api
|
2018-08-14 18:09:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Upload') {
|
|
|
|
steps {
|
2018-11-19 17:37:04 +00:00
|
|
|
script {
|
2018-12-07 12:14:03 +00:00
|
|
|
/* e2e builds get tested in SauceLabs */
|
2018-12-11 14:27:21 +00:00
|
|
|
if (cmn.getBuildType() == 'e2e') {
|
2018-12-07 12:14:03 +00:00
|
|
|
env.SAUCE_URL = mobile.ios.uploadToSauceLabs()
|
2018-12-13 13:22:36 +00:00
|
|
|
env.PKG_URL = cmn.uploadArtifact(api)
|
2018-12-07 12:14:03 +00:00
|
|
|
} else {
|
2018-12-11 14:27:21 +00:00
|
|
|
env.PKG_URL = mobile.ios.uploadToDiawi()
|
2018-11-19 17:37:04 +00:00
|
|
|
}
|
|
|
|
}
|
2018-08-14 18:09:52 +00:00
|
|
|
}
|
|
|
|
}
|
2018-12-11 14:27:21 +00:00
|
|
|
stage('Notify') {
|
|
|
|
steps {
|
2018-12-13 13:22:36 +00:00
|
|
|
script { cmn.notifyPRSuccess() }
|
2018-12-11 14:27:21 +00:00
|
|
|
}
|
|
|
|
}
|
2018-12-13 09:49:16 +00:00
|
|
|
stage('Cleanup') {
|
|
|
|
steps {
|
|
|
|
script { cmn.clean() }
|
|
|
|
}
|
|
|
|
}
|
2018-12-11 14:27:21 +00:00
|
|
|
}
|
|
|
|
post {
|
2018-12-13 13:22:36 +00:00
|
|
|
failure { script { load('ci/common.groovy').notifyPRFailure() } }
|
2018-08-14 18:09:52 +00:00
|
|
|
}
|
|
|
|
}
|