2020-09-24 12:24:57 +00:00
|
|
|
library 'status-react-jenkins@v1.2.4'
|
2020-03-06 15:43:04 +00:00
|
|
|
|
2018-08-14 18:09:52 +00:00
|
|
|
pipeline {
|
2020-02-27 14:16:09 +00:00
|
|
|
agent { label 'linux' }
|
2018-08-14 18:09:52 +00:00
|
|
|
|
|
|
|
options {
|
2018-12-11 14:27:21 +00:00
|
|
|
timestamps()
|
2018-08-14 18:09:52 +00:00
|
|
|
disableConcurrentBuilds()
|
2018-10-30 09:38:52 +00:00
|
|
|
/* Prevent Jenkins jobs from running forever */
|
2020-07-02 09:58:45 +00:00
|
|
|
timeout(time: 40, unit: 'MINUTES')
|
2018-10-30 09:38:52 +00:00
|
|
|
/* Limit builds retained */
|
2018-08-14 18:09:52 +00:00
|
|
|
buildDiscarder(logRotator(
|
|
|
|
numToKeepStr: '10',
|
|
|
|
daysToKeepStr: '30',
|
|
|
|
artifactNumToKeepStr: '10',
|
|
|
|
))
|
|
|
|
}
|
2018-08-29 07:43:21 +00:00
|
|
|
|
2018-08-14 18:09:52 +00:00
|
|
|
stages {
|
2018-08-29 07:43:21 +00:00
|
|
|
stage('Prep') {
|
2018-08-14 18:09:52 +00:00
|
|
|
steps { script {
|
2018-08-29 07:43:21 +00:00
|
|
|
println "Current JOB: ${env.JOB_NAME}"
|
2018-10-02 20:40:36 +00:00
|
|
|
/* just for a shorter access */
|
2020-03-06 15:43:04 +00:00
|
|
|
btype = utils.getBuildType()
|
2018-08-14 18:09:52 +00:00
|
|
|
} }
|
|
|
|
}
|
|
|
|
stage('Build') {
|
|
|
|
parallel {
|
2019-08-08 17:15:13 +00:00
|
|
|
stage('iOS') { steps { script {
|
2020-03-06 15:43:04 +00:00
|
|
|
ios = jenkins.Build('status-react/combined/mobile-ios')
|
2019-08-08 17:15:13 +00:00
|
|
|
} } }
|
2018-08-21 15:17:25 +00:00
|
|
|
stage('Android') { steps { script {
|
2020-03-06 15:43:04 +00:00
|
|
|
apk = jenkins.Build('status-react/combined/mobile-android')
|
2018-08-21 15:17:25 +00:00
|
|
|
} } }
|
|
|
|
stage('Android e2e') { steps { script {
|
2020-03-06 15:43:04 +00:00
|
|
|
apke2e = jenkins.Build('status-react/combined/mobile-android-e2e')
|
2018-08-21 15:17:25 +00:00
|
|
|
} } }
|
2018-08-14 18:09:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Archive') {
|
2018-08-21 15:17:25 +00:00
|
|
|
steps { script {
|
2018-08-14 18:09:52 +00:00
|
|
|
sh('rm -f pkg/*')
|
2020-03-06 15:43:04 +00:00
|
|
|
jenkins.copyArts(ios)
|
|
|
|
//jenkins.copyArts(iose2e)
|
|
|
|
jenkins.copyArts(apk)
|
|
|
|
jenkins.copyArts(apke2e)
|
2020-07-08 14:08:51 +00:00
|
|
|
sha = "pkg/${utils.pkgFilename('sha256')}"
|
2018-11-29 14:23:51 +00:00
|
|
|
dir('pkg') {
|
|
|
|
/* generate sha256 checksums for upload */
|
2020-07-08 14:08:51 +00:00
|
|
|
sh "sha256sum * | tee ../${sha}"
|
2018-11-29 14:23:51 +00:00
|
|
|
archiveArtifacts('*')
|
|
|
|
}
|
2018-08-21 15:17:25 +00:00
|
|
|
} }
|
2018-08-14 18:09:52 +00:00
|
|
|
}
|
|
|
|
stage('Upload') {
|
|
|
|
steps { script {
|
2018-12-11 14:27:21 +00:00
|
|
|
/* object for easier URLs handling */
|
|
|
|
urls = [
|
|
|
|
/* mobile */
|
2020-03-06 15:43:04 +00:00
|
|
|
Apk: utils.pkgUrl(apk), Apke2e: utils.pkgUrl(apke2e),
|
|
|
|
iOS: utils.pkgUrl(ios), /*iOSe2e: utils.pkgUrl(iose2e),*/
|
|
|
|
Diawi: utils.utils.getEnv(ios, 'DIAWI_URL'),
|
2018-12-11 14:27:21 +00:00
|
|
|
/* upload the sha256 checksums file too */
|
2020-07-08 14:08:51 +00:00
|
|
|
SHA: s3.uploadArtifact(sha),
|
2018-12-11 14:27:21 +00:00
|
|
|
]
|
2018-10-02 20:40:36 +00:00
|
|
|
/* add URLs to the build description */
|
2020-03-06 15:43:04 +00:00
|
|
|
jenkins.setBuildDesc(urls)
|
2019-02-22 20:35:22 +00:00
|
|
|
/* Create JSON file with newest build URLs */
|
|
|
|
switch (btype) {
|
|
|
|
/* legacy naming, should have named it nightly.json */
|
2020-03-06 15:43:04 +00:00
|
|
|
case 'nightly': s3.updateBucketJSON(urls, 'latest.json'); break
|
2018-11-08 10:13:40 +00:00
|
|
|
}
|
2018-08-14 18:09:52 +00:00
|
|
|
} }
|
|
|
|
}
|
|
|
|
stage('Publish') {
|
2018-09-19 13:35:38 +00:00
|
|
|
steps { script {
|
2019-02-05 09:35:14 +00:00
|
|
|
switch (btype) {
|
2020-02-14 16:36:24 +00:00
|
|
|
case 'nightly': build(job: 'misc/status.im', wait: false); break
|
2020-03-25 16:05:48 +00:00
|
|
|
case 'release': github.publishReleaseMobile(); break
|
2019-02-05 09:35:14 +00:00
|
|
|
}
|
2018-09-19 13:35:38 +00:00
|
|
|
} }
|
2018-08-14 18:09:52 +00:00
|
|
|
}
|
2018-08-29 15:39:49 +00:00
|
|
|
stage('Run e2e') {
|
2018-10-02 20:40:36 +00:00
|
|
|
when { expression { btype == 'nightly' } }
|
2018-08-29 15:39:49 +00:00
|
|
|
steps { script {
|
2020-03-06 15:43:04 +00:00
|
|
|
e2eApk = utils.getEnv(apke2e, 'SAUCE_URL')
|
2018-11-13 18:35:17 +00:00
|
|
|
build(
|
2020-03-06 15:43:04 +00:00
|
|
|
job: 'end-to-end-tests/status-app-nightly',
|
|
|
|
parameters: [string(name: 'APK_NAME', value: e2eApk)],
|
|
|
|
wait: false
|
2018-11-13 18:35:17 +00:00
|
|
|
)
|
2018-08-29 15:39:49 +00:00
|
|
|
} }
|
|
|
|
}
|
2018-08-14 18:09:52 +00:00
|
|
|
}
|
|
|
|
}
|