2018-08-14 18:09:52 +00:00
|
|
|
pipeline {
|
|
|
|
agent { label 'master' }
|
|
|
|
|
|
|
|
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 */
|
2018-11-06 21:29:16 +00:00
|
|
|
timeout(time: 45, 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}"
|
|
|
|
/* load common lib */
|
2018-08-23 12:56:19 +00:00
|
|
|
cmn = load('ci/common.groovy')
|
2018-10-02 20:40:36 +00:00
|
|
|
/* just for a shorter access */
|
2019-02-05 09:35:14 +00:00
|
|
|
btype = cmn.utils.getBuildType()
|
2018-08-14 18:09:52 +00:00
|
|
|
} }
|
|
|
|
}
|
|
|
|
stage('Build') {
|
|
|
|
parallel {
|
2018-12-06 10:54:28 +00:00
|
|
|
stage('MacOS') { steps { script {
|
2019-02-05 09:35:14 +00:00
|
|
|
osx = cmn.ci.Build('status-react/combined/desktop-macos')
|
2018-08-21 15:17:25 +00:00
|
|
|
} } }
|
2018-12-06 10:54:28 +00:00
|
|
|
stage('Linux') { steps { script {
|
2019-02-05 09:35:14 +00:00
|
|
|
nix = cmn.ci.Build('status-react/combined/desktop-linux')
|
2018-08-21 15:17:25 +00:00
|
|
|
} } }
|
2018-12-06 10:54:28 +00:00
|
|
|
stage('Windows') { steps { script {
|
2019-02-05 09:35:14 +00:00
|
|
|
win = cmn.ci.Build('status-react/combined/desktop-windows')
|
2018-11-06 21:29:16 +00:00
|
|
|
} } }
|
2018-08-21 15:17:25 +00:00
|
|
|
stage('iOS') { steps { script {
|
2019-02-05 09:35:14 +00:00
|
|
|
ios = cmn.ci.Build('status-react/combined/mobile-ios')
|
2018-08-21 15:17:25 +00:00
|
|
|
} } }
|
2019-03-01 01:17:39 +00:00
|
|
|
//stage('iOS e2e') { steps { script {
|
2019-02-05 09:35:14 +00:00
|
|
|
// iose2e = cmn.ci.Build('status-react/combined/mobile-ios-e2e')
|
2019-03-01 01:17:39 +00:00
|
|
|
//} } }
|
2018-08-21 15:17:25 +00:00
|
|
|
stage('Android') { steps { script {
|
2019-02-05 09:35:14 +00:00
|
|
|
apk = cmn.ci.Build('status-react/combined/mobile-android')
|
2018-08-21 15:17:25 +00:00
|
|
|
} } }
|
|
|
|
stage('Android e2e') { steps { script {
|
2019-02-05 09:35:14 +00:00
|
|
|
apke2e = cmn.ci.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/*')
|
2018-10-02 20:40:36 +00:00
|
|
|
if (btype != 'release') {
|
2019-02-05 09:35:14 +00:00
|
|
|
cmn.ci.copyArts(osx)
|
|
|
|
cmn.ci.copyArts(nix)
|
|
|
|
cmn.ci.copyArts(win)
|
2018-09-04 06:31:28 +00:00
|
|
|
}
|
2019-02-05 09:35:14 +00:00
|
|
|
cmn.ci.copyArts(ios)
|
|
|
|
//cmn.ci.copyArts(iose2e)
|
|
|
|
cmn.ci.copyArts(apk)
|
|
|
|
cmn.ci.copyArts(apke2e)
|
2018-11-29 14:23:51 +00:00
|
|
|
dir('pkg') {
|
|
|
|
/* generate sha256 checksums for upload */
|
2019-02-05 09:35:14 +00:00
|
|
|
sh "sha256sum * | tee ${cmn.utils.pkgFilename(btype, 'sha256')}"
|
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 */
|
|
|
|
Apk: cmn.pkgUrl(apk), Apke2e: cmn.pkgUrl(apke2e),
|
2019-03-01 08:30:10 +00:00
|
|
|
iOS: cmn.pkgUrl(ios), /*iOSe2e: cmn.pkgUrl(iose2e),*/
|
2019-02-05 09:35:14 +00:00
|
|
|
Diawi: cmn.utils.getEnv(ios, 'DIAWI_URL'),
|
2018-12-11 14:27:21 +00:00
|
|
|
/* desktop */
|
2018-12-13 17:03:05 +00:00
|
|
|
App: cmn.pkgUrl(nix), Mac: cmn.pkgUrl(osx), Win: cmn.pkgUrl(win),
|
2018-12-11 14:27:21 +00:00
|
|
|
/* upload the sha256 checksums file too */
|
2019-02-05 09:35:14 +00:00
|
|
|
SHA: cmn.utils.uploadArtifact(cmn.utils.pkgFind('sha256')),
|
2018-12-11 14:27:21 +00:00
|
|
|
]
|
2018-10-02 20:40:36 +00:00
|
|
|
/* add URLs to the build description */
|
2019-02-05 09:35:14 +00:00
|
|
|
cmn.ci.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 */
|
|
|
|
case 'nightly': cmn.updateBucketJSON(urls, 'latest.json'); break
|
|
|
|
case 'release': cmn.updateBucketJSON(urls, 'release.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) {
|
|
|
|
case 'nightly': build('misc/status.im'); break
|
|
|
|
case 'release': cmn.gh.publishReleaseMobile(); break
|
|
|
|
}
|
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 {
|
2019-02-05 09:35:14 +00:00
|
|
|
e2eApk = cmn.utils.getEnv(apke2e, 'SAUCE_URL')
|
2018-11-13 18:35:17 +00:00
|
|
|
build(
|
|
|
|
job: 'end-to-end-tests/status-app-nightly', wait: false,
|
|
|
|
parameters: [string(name: 'apk', value: "--apk=${e2eApk}")]
|
|
|
|
)
|
2018-08-29 15:39:49 +00:00
|
|
|
} }
|
|
|
|
}
|
2018-08-14 18:09:52 +00:00
|
|
|
}
|
|
|
|
}
|