2022-09-01 11:28:24 +00:00
|
|
|
library 'status-jenkins-lib@v1.5.3'
|
2020-03-06 15:43:04 +00:00
|
|
|
|
2022-06-28 18:46:54 +00:00
|
|
|
/* Options section can't access functions in objects. */
|
|
|
|
def isPRBuild = utils.isPRBuild()
|
|
|
|
|
2018-08-14 18:09:52 +00:00
|
|
|
pipeline {
|
2022-09-12 10:31:06 +00:00
|
|
|
agent { label 'macos && x86_64 && nix-2.8 && xcode-13.4' }
|
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-10-30 09:38:52 +00:00
|
|
|
/* Prevent Jenkins jobs from running forever */
|
2020-08-04 08:34:32 +00:00
|
|
|
timeout(time: 25, 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
|
|
|
))
|
2020-05-11 09:04:11 +00:00
|
|
|
/* Allows combined build to copy */
|
2022-07-17 12:37:46 +00:00
|
|
|
copyArtifactPermission('/status-mobile/*')
|
2022-06-28 18:46:54 +00:00
|
|
|
/* Abort old PR builds. */
|
|
|
|
disableConcurrentBuilds(
|
|
|
|
abortPrevious: isPRBuild
|
|
|
|
)
|
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 {
|
2019-05-10 15:33:54 +00:00
|
|
|
LANG = "en_US.UTF-8"
|
|
|
|
LC_ALL = "en_US.UTF-8"
|
|
|
|
LANGUAGE = "en_US.UTF-8"
|
2019-11-29 10:20:08 +00:00
|
|
|
TARGET = 'ios'
|
2019-03-25 16:35:01 +00:00
|
|
|
NIX_CONF_DIR = "${env.WORKSPACE}/nix"
|
2019-10-09 15:37:58 +00:00
|
|
|
/* See nix/README.md */
|
|
|
|
NIX_IGNORE_SYMLINK_STORE = 1
|
2019-05-10 15:33:54 +00:00
|
|
|
FASTLANE_DISABLE_COLORS = 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 {
|
2019-05-29 16:52:41 +00:00
|
|
|
script {
|
2020-03-06 15:43:04 +00:00
|
|
|
btype = utils.getBuildType()
|
2019-02-05 09:35:14 +00:00
|
|
|
print "Running ${btype} build!"
|
2019-01-15 14:44:50 +00:00
|
|
|
/* Cleanup and Prep */
|
2020-03-06 15:43:04 +00:00
|
|
|
commonPrep(btype)
|
2019-01-15 14:44:50 +00:00
|
|
|
}
|
2018-08-14 18:09:52 +00:00
|
|
|
}
|
|
|
|
}
|
2022-08-26 13:18:45 +00:00
|
|
|
stage('JSBundle') {
|
|
|
|
steps {
|
|
|
|
script { ios.jsbundle() }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Bundle') {
|
|
|
|
steps {
|
|
|
|
script { api = ios.bundle() }
|
2019-03-05 18:00:20 +00:00
|
|
|
}
|
2018-08-14 18:09:52 +00:00
|
|
|
}
|
2019-10-09 15:37:58 +00:00
|
|
|
stage('Parallel Upload') {
|
|
|
|
parallel {
|
|
|
|
stage('Archive') {
|
|
|
|
steps {
|
|
|
|
archiveArtifacts api
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Upload') {
|
2022-08-26 13:18:45 +00:00
|
|
|
steps { script {
|
|
|
|
env.PKG_URL = s3.uploadArtifact(api)
|
|
|
|
jenkins.setBuildDesc(IPA: env.PKG_URL)
|
|
|
|
/* e2e builds get tested in SauceLabs */
|
|
|
|
if (utils.isE2EBuild()) {
|
|
|
|
env.SAUCE_URL = ios.uploadToSauceLabs()
|
2022-09-08 07:43:39 +00:00
|
|
|
} else if (!utils.isReleaseBuild()) {
|
2022-08-26 13:18:45 +00:00
|
|
|
env.DIAWI_URL = ios.uploadToDiawi()
|
2019-10-09 15:37:58 +00:00
|
|
|
}
|
2022-08-26 13:18:45 +00:00
|
|
|
} }
|
2018-11-19 17:37:04 +00:00
|
|
|
}
|
2018-08-14 18:09:52 +00:00
|
|
|
}
|
|
|
|
}
|
2018-12-11 14:27:21 +00:00
|
|
|
}
|
|
|
|
post {
|
2020-03-06 15:43:04 +00:00
|
|
|
success { script { github.notifyPR(true) } }
|
|
|
|
failure { script { github.notifyPR(false) } }
|
2022-08-26 13:18:45 +00:00
|
|
|
always { sh 'make purge' }
|
2018-08-14 18:09:52 +00:00
|
|
|
}
|
|
|
|
}
|