status-mobile/ci/Jenkinsfile.combined
Jakub Sokołowski 84286782f6
bump status-react-jenkins to 1.2.0
This updates a bunch of things in the Jenkins logic.
For details of that see:
https://github.com/status-im/status-react-jenkins/pull/12

It grew out of the changes I made to make PR builds available in Desktop client:
https://github.com/status-im/nim-status-client/pull/507

Changes:
- Bump `status-react-jenkins` library to newer version, probably `1.2.0`
- Update use of `utils.pkgFilename()` in `ci/Jenkinsfile.combined`
- Make all iOS builds go into the same folder: `status-ios`
- Drop e2e build type, infer it from Android ABIs set to `x86` only
- Simplify logic in `nix/mobile/android/release.nix.`

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2020-07-13 12:13:47 +02:00

96 lines
2.7 KiB
Plaintext

library 'status-react-jenkins@v1.2.0'
pipeline {
agent { label 'linux' }
options {
timestamps()
disableConcurrentBuilds()
/* Prevent Jenkins jobs from running forever */
timeout(time: 40, unit: 'MINUTES')
/* Limit builds retained */
buildDiscarder(logRotator(
numToKeepStr: '10',
daysToKeepStr: '30',
artifactNumToKeepStr: '10',
))
}
stages {
stage('Prep') {
steps { script {
println "Current JOB: ${env.JOB_NAME}"
/* just for a shorter access */
btype = utils.getBuildType()
} }
}
stage('Build') {
parallel {
stage('iOS') { steps { script {
ios = jenkins.Build('status-react/combined/mobile-ios')
} } }
stage('Android') { steps { script {
apk = jenkins.Build('status-react/combined/mobile-android')
} } }
stage('Android e2e') { steps { script {
apke2e = jenkins.Build('status-react/combined/mobile-android-e2e')
} } }
}
}
stage('Archive') {
steps { script {
sh('rm -f pkg/*')
jenkins.copyArts(ios)
//jenkins.copyArts(iose2e)
jenkins.copyArts(apk)
jenkins.copyArts(apke2e)
sha = "pkg/${utils.pkgFilename('sha256')}"
dir('pkg') {
/* generate sha256 checksums for upload */
sh "sha256sum * | tee ../${sha}"
archiveArtifacts('*')
}
} }
}
stage('Upload') {
steps { script {
/* object for easier URLs handling */
urls = [
/* mobile */
Apk: utils.pkgUrl(apk), Apke2e: utils.pkgUrl(apke2e),
iOS: utils.pkgUrl(ios), /*iOSe2e: utils.pkgUrl(iose2e),*/
Diawi: utils.utils.getEnv(ios, 'DIAWI_URL'),
/* upload the sha256 checksums file too */
SHA: s3.uploadArtifact(sha),
]
/* add URLs to the build description */
jenkins.setBuildDesc(urls)
/* Create JSON file with newest build URLs */
switch (btype) {
/* legacy naming, should have named it nightly.json */
case 'nightly': s3.updateBucketJSON(urls, 'latest.json'); break
}
} }
}
stage('Publish') {
steps { script {
switch (btype) {
case 'nightly': build(job: 'misc/status.im', wait: false); break
case 'release': github.publishReleaseMobile(); break
}
} }
}
stage('Run e2e') {
when { expression { btype == 'nightly' } }
steps { script {
e2eApk = utils.getEnv(apke2e, 'SAUCE_URL')
build(
job: 'end-to-end-tests/status-app-nightly',
parameters: [string(name: 'APK_NAME', value: e2eApk)],
wait: false
)
} }
}
}
}