Files
status-react/ci/Jenkinsfile.android
T

92 lines
2.2 KiB
Groovy
Raw Normal View History

2023-06-29 15:40:43 +02:00
#!/usr/bin/env groovy
library 'status-jenkins-lib@v1.8.12'
2020-03-06 16:43:04 +01:00
2022-06-28 20:46:54 +02:00
/* Options section can't access functions in objects. */
def isPRBuild = utils.isPRBuild()
pipeline {
2024-02-07 11:44:43 +01:00
agent { label 'linux && x86_64 && nix-2.19' }
options {
2018-11-13 12:58:34 +01:00
timestamps()
2018-10-30 10:38:52 +01:00
/* Prevent Jenkins jobs from running forever */
2021-06-17 15:44:34 +02:00
timeout(time: 30, unit: 'MINUTES')
2018-10-30 10:38:52 +01:00
/* Limit builds retained */
buildDiscarder(logRotator(
numToKeepStr: '10',
daysToKeepStr: '20',
2024-02-28 15:50:47 +01:00
artifactNumToKeepStr: '1',
))
/* Allows combined build to copy */
2022-07-17 14:37:46 +02:00
copyArtifactPermission('/status-mobile/*')
2022-06-28 20:46:54 +02:00
/* Abort old PR builds. */
disableConcurrentBuilds(
abortPrevious: isPRBuild
)
}
2018-09-25 20:01:48 +03:00
2018-12-11 12:00:22 +01:00
parameters {
string(
2018-12-11 12:00:22 +01:00
name: 'BUILD_TYPE',
description: 'Specify build type. Values: pr / e2e / nightly / release',
2018-12-11 12:00:22 +01:00
defaultValue: 'pr',
)
}
environment {
LANG = 'en_US.UTF-8'
LC_ALL = 'en_US.UTF-8'
LANGUAGE = 'en_US.UTF-8'
PLATFORM = "android${utils.isE2EBuild() ? "-e2e" : ""}"
BUILD_ENV = 'prod'
NIX_CONF_DIR = "${env.WORKSPACE}/nix"
FASTLANE_DISABLE_COLORS = 1
}
2018-09-25 20:01:48 +03:00
stages {
stage('Prep') {
steps {
script {
utils.symlinkEnv()
println("Build Number: ${utils.genBuildNumber()}")
}
}
}
2022-08-26 15:18:45 +02:00
stage('Bundle') {
steps {
script { apks = android.bundle() }
}
}
stage('Sign') {
steps {
script { apks = android.sign(apks) }
}
}
2019-10-09 18:37:58 +03:00
stage('Parallel Upload') {
parallel {
stage('Archive') {
steps { script {
apks.each { archiveArtifacts it }
} }
}
stage('Upload') {
2022-08-26 15:18:45 +02:00
steps { script {
def urls = apks.collect { s3.uploadArtifact(it) }
2023-02-03 17:09:08 +01:00
if (urls.size() > 1) { /* Return only the universal APK. */
2022-08-26 15:18:45 +02:00
env.PKG_URL = urls.find { it.contains('universal') }
2023-02-03 17:09:08 +01:00
} else { /* If no universal is available pick first. */
2022-08-26 15:18:45 +02:00
env.PKG_URL = urls.first()
2019-10-09 18:37:58 +03:00
}
2022-08-26 15:18:45 +02:00
jenkins.setBuildDesc(APK: env.PKG_URL)
} }
2018-08-27 11:32:54 -04:00
}
}
}
}
post {
2020-03-06 16:43:04 +01:00
success { script { github.notifyPR(true) } }
failure { script { github.notifyPR(false) } }
2022-08-26 15:18:45 +02:00
always { sh 'make purge' }
}
}