2018-08-14 18:09:52 +00:00
|
|
|
pipeline {
|
|
|
|
agent { label 'master' }
|
|
|
|
|
|
|
|
options {
|
|
|
|
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 */
|
|
|
|
btype = cmn.getBuildType()
|
2018-08-21 15:17:25 +00:00
|
|
|
/* to avoid missing build tag parallel builds */
|
2018-08-23 12:56:19 +00:00
|
|
|
print "Build Number: ${cmn.tagBuild(true)}"
|
2018-08-14 18:09:52 +00:00
|
|
|
} }
|
|
|
|
}
|
|
|
|
stage('Build') {
|
|
|
|
parallel {
|
2018-09-04 06:31:28 +00:00
|
|
|
stage('MacOS') {
|
2018-10-02 20:40:36 +00:00
|
|
|
when { expression { btype != 'release' } }
|
2018-09-04 06:31:28 +00:00
|
|
|
steps { script {
|
2018-10-02 20:40:36 +00:00
|
|
|
osx = cmn.buildBranch('status-react/combined/desktop-macos')
|
2018-08-21 15:17:25 +00:00
|
|
|
} } }
|
2018-09-04 06:31:28 +00:00
|
|
|
stage('Linux') {
|
2018-10-02 20:40:36 +00:00
|
|
|
when { expression { btype != 'release' } }
|
2018-09-04 06:31:28 +00:00
|
|
|
steps { script {
|
2018-10-02 20:40:36 +00:00
|
|
|
nix = cmn.buildBranch('status-react/combined/desktop-linux')
|
2018-08-21 15:17:25 +00:00
|
|
|
} } }
|
2018-11-06 21:29:16 +00:00
|
|
|
stage('Windows') {
|
|
|
|
when { expression { btype != 'release' } }
|
|
|
|
steps { script {
|
|
|
|
win = cmn.buildBranch('status-react/combined/desktop-windows')
|
|
|
|
} } }
|
2018-08-21 15:17:25 +00:00
|
|
|
stage('iOS') { steps { script {
|
2018-10-02 20:40:36 +00:00
|
|
|
ios = cmn.buildBranch('status-react/combined/mobile-ios')
|
2018-08-21 15:17:25 +00:00
|
|
|
} } }
|
|
|
|
stage('Android') { steps { script {
|
2018-10-02 20:40:36 +00:00
|
|
|
dro = cmn.buildBranch('status-react/combined/mobile-android')
|
2018-08-21 15:17:25 +00:00
|
|
|
} } }
|
|
|
|
stage('Android e2e') { steps { script {
|
2018-08-23 12:56:19 +00:00
|
|
|
e2e = cmn.buildBranch('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-09-04 06:31:28 +00:00
|
|
|
|
2018-10-02 20:40:36 +00:00
|
|
|
if (btype != 'release') {
|
2018-09-04 06:31:28 +00:00
|
|
|
cmn.copyArts('status-react/combined/desktop-macos', osx.number)
|
|
|
|
cmn.copyArts('status-react/combined/desktop-linux', nix.number)
|
2018-11-06 21:29:16 +00:00
|
|
|
cmn.copyArts('status-react/combined/desktop-windows', win.number)
|
2018-09-04 06:31:28 +00:00
|
|
|
}
|
2018-09-18 12:22:30 +00:00
|
|
|
cmn.copyArts('status-react/combined/mobile-ios', ios.number)
|
2018-08-23 12:56:19 +00:00
|
|
|
cmn.copyArts('status-react/combined/mobile-android', dro.number)
|
|
|
|
cmn.copyArts('status-react/combined/mobile-android', e2e.number)
|
2018-10-02 20:40:36 +00:00
|
|
|
cmn.copyArts('status-react/combined/mobile-ios', ios.number)
|
2018-08-14 18:09:52 +00:00
|
|
|
archiveArtifacts('pkg/*')
|
2018-08-21 15:17:25 +00:00
|
|
|
} }
|
2018-08-14 18:09:52 +00:00
|
|
|
}
|
|
|
|
stage('Upload') {
|
|
|
|
steps { script {
|
2018-10-02 20:40:36 +00:00
|
|
|
e2eUrl = cmn.uploadArtifact(cmn.pkgFind('e2e.apk'))
|
|
|
|
apkUrl = cmn.uploadArtifact(cmn.pkgFind("${btype}.apk"))
|
|
|
|
if (btype != 'release') {
|
|
|
|
dmgUrl = cmn.uploadArtifact(cmn.pkgFind('dmg'))
|
|
|
|
appUrl = cmn.uploadArtifact(cmn.pkgFind('AppImage'))
|
2018-11-06 21:29:16 +00:00
|
|
|
zipUrl = cmn.uploadArtifact(cmn.pkgFind('zip'))
|
2018-09-04 06:31:28 +00:00
|
|
|
} else {
|
|
|
|
dmgUrl = null
|
|
|
|
appUrl = null
|
2018-11-06 21:29:16 +00:00
|
|
|
zipUrl = null
|
2018-09-04 06:31:28 +00:00
|
|
|
}
|
2018-08-27 15:32:54 +00:00
|
|
|
/* special case for iOS Diawi links */
|
2018-08-22 18:28:16 +00:00
|
|
|
ipaUrl = ios.getBuildVariables().get('DIAWI_URL')
|
2018-10-02 20:40:36 +00:00
|
|
|
/* add URLs to the build description */
|
|
|
|
cmn.setBuildDesc(
|
2018-11-06 21:29:16 +00:00
|
|
|
Apk: apkUrl, e2e: e2eUrl, iOS: ipaUrl, App: appUrl, Mac: dmgUrl, Win: zipUrl,
|
2018-10-02 20:40:36 +00:00
|
|
|
)
|
2018-11-08 10:13:40 +00:00
|
|
|
/* Create latest.json with newest nightly URLs */
|
|
|
|
if (btype == 'nightly') {
|
|
|
|
cmn.updateLatestNightlies(
|
2018-11-14 16:37:51 +00:00
|
|
|
APK: apkUrl, IOS: ipaUrl, APP: appUrl, MAC: dmgUrl, WIN: zipUrl
|
2018-11-08 10:13:40 +00:00
|
|
|
)
|
|
|
|
}
|
2018-08-14 18:09:52 +00:00
|
|
|
} }
|
|
|
|
}
|
|
|
|
stage('Notify') {
|
2018-08-27 15:32:54 +00:00
|
|
|
steps { script {
|
2018-08-29 07:43:21 +00:00
|
|
|
if (env.CHANGE_ID != null) {
|
2018-08-29 15:39:49 +00:00
|
|
|
cmn.githubNotify(
|
2018-11-13 18:35:17 +00:00
|
|
|
apk: apkUrl, e2e: e2eUrl, ipa: ipaUrl, app: appUrl, dmg: dmgUrl, win: zipUrl,
|
2018-08-29 15:39:49 +00:00
|
|
|
)
|
2018-08-29 07:43:21 +00:00
|
|
|
}
|
2018-08-27 15:32:54 +00:00
|
|
|
} }
|
2018-08-14 18:09:52 +00:00
|
|
|
}
|
|
|
|
stage('Publish') {
|
2018-09-19 13:35:38 +00:00
|
|
|
steps { script {
|
2018-10-02 20:40:36 +00:00
|
|
|
switch (btype) {
|
2018-09-19 13:35:38 +00:00
|
|
|
case 'nightly':
|
2018-11-13 18:15:52 +00:00
|
|
|
build('misc/status.im')
|
|
|
|
break
|
2018-09-19 13:35:38 +00:00
|
|
|
case 'release':
|
|
|
|
build(
|
|
|
|
job: 'misc/cn.status.im',
|
|
|
|
parameters: [
|
|
|
|
[name: 'APK_URL', value: apkUrl, $class: 'StringParameterValue'],
|
|
|
|
]
|
2018-11-13 18:15:52 +00:00
|
|
|
)
|
|
|
|
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 {
|
|
|
|
e2eApk = e2e.getBuildVariables().get('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
|
|
|
}
|
|
|
|
}
|