2018-08-14 18:09:52 +00:00
|
|
|
pipeline {
|
|
|
|
agent { label 'master' }
|
|
|
|
|
|
|
|
options {
|
|
|
|
disableConcurrentBuilds()
|
|
|
|
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-08-29 07:43:21 +00:00
|
|
|
|
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') {
|
|
|
|
when { expression { cmn.getBuildType() != 'release' } }
|
|
|
|
steps { script {
|
2018-08-29 07:43:21 +00:00
|
|
|
osx = cmn.buildBranch('status-react/combined/desktop-macos', cmn.getBuildType())
|
2018-08-21 15:17:25 +00:00
|
|
|
} } }
|
2018-09-04 06:31:28 +00:00
|
|
|
stage('Linux') {
|
|
|
|
when { expression { cmn.getBuildType() != 'release' } }
|
|
|
|
steps { script {
|
2018-08-29 07:43:21 +00:00
|
|
|
nix = cmn.buildBranch('status-react/combined/desktop-linux', cmn.getBuildType())
|
2018-08-21 15:17:25 +00:00
|
|
|
} } }
|
|
|
|
stage('iOS') { steps { script {
|
2018-08-29 07:43:21 +00:00
|
|
|
ios = cmn.buildBranch('status-react/combined/mobile-ios', cmn.getBuildType())
|
2018-08-21 15:17:25 +00:00
|
|
|
} } }
|
|
|
|
stage('Android') { steps { script {
|
2018-08-29 07:43:21 +00:00
|
|
|
dro = cmn.buildBranch('status-react/combined/mobile-android', cmn.getBuildType())
|
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
|
|
|
|
|
|
|
if (cmn.getBuildType() != 'release') {
|
|
|
|
cmn.copyArts('status-react/combined/desktop-macos', osx.number)
|
|
|
|
cmn.copyArts('status-react/combined/desktop-linux', nix.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-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-08-30 12:05:41 +00:00
|
|
|
e2eUrl = cmn.uploadArtifact(findFiles(glob: 'pkg/*e2e.apk')[0].path)
|
|
|
|
apkUrl = cmn.uploadArtifact(findFiles(glob: "pkg/*${cmn.getBuildType()}.apk")[0].path)
|
2018-09-04 06:31:28 +00:00
|
|
|
|
|
|
|
if (cmn.getBuildType() != 'release') {
|
|
|
|
dmgUrl = cmn.uploadArtifact(findFiles(glob: 'pkg/*.dmg')[0].path)
|
|
|
|
appUrl = cmn.uploadArtifact(findFiles(glob: 'pkg/*.AppImage')[0].path)
|
|
|
|
} else {
|
|
|
|
dmgUrl = null
|
|
|
|
appUrl = null
|
|
|
|
}
|
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-08-14 18:09:52 +00:00
|
|
|
} }
|
|
|
|
}
|
|
|
|
stage('Notify') {
|
2018-08-27 15:32:54 +00:00
|
|
|
steps { script {
|
2018-09-04 06:31:28 +00:00
|
|
|
def dmgLink = "<${dmgUrl}|MacOS>"
|
|
|
|
def appLink = "<${appUrl}|AppImage>"
|
2018-08-29 07:43:21 +00:00
|
|
|
def message = (
|
2018-08-29 15:39:49 +00:00
|
|
|
(env.CHANGE_ID != null ?
|
|
|
|
"Build PR #${BRANCH_NAME}(${CHANGE_BRANCH}) success! " :
|
|
|
|
"Build ${cmn.getBuildType()} success! "
|
|
|
|
)+
|
|
|
|
"<${currentBuild.absoluteUrl}|${currentBuild.displayName}> "+
|
|
|
|
"(${currentBuild.durationString})\n"+
|
2018-09-04 06:31:28 +00:00
|
|
|
"Packages: <${apkUrl}|Android>, (<${e2eUrl}|e2e>), <${ipaUrl}|iOS>"
|
2018-08-29 07:43:21 +00:00
|
|
|
)
|
2018-09-04 06:31:28 +00:00
|
|
|
|
|
|
|
if (dmgUrl != null) {
|
|
|
|
message = message + ", <${dmgUrl}|MacOS>"
|
|
|
|
}
|
|
|
|
|
|
|
|
if (appUrl != null) {
|
|
|
|
message = message + ", <${appUrl}|AppImage>"
|
|
|
|
}
|
|
|
|
|
2018-08-29 07:43:21 +00:00
|
|
|
slackSend(
|
|
|
|
message: message,
|
2018-08-14 18:09:52 +00:00
|
|
|
color: 'good'
|
|
|
|
)
|
2018-08-29 07:43:21 +00:00
|
|
|
if (env.CHANGE_ID != null) {
|
2018-08-29 15:39:49 +00:00
|
|
|
cmn.githubNotify(
|
|
|
|
apkUrl, e2eUrl, ipaUrl, dmgUrl, appUrl,
|
|
|
|
env.CHANGE_ID
|
|
|
|
)
|
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-08-29 07:43:21 +00:00
|
|
|
when { expression { cmn.getBuildType() == 'nightly' } }
|
2018-08-14 18:09:52 +00:00
|
|
|
steps {
|
|
|
|
build(
|
|
|
|
job: 'misc/status-im.github.io-update_env',
|
|
|
|
parameters: [
|
|
|
|
[name: 'APK_URL', value: apkUrl, $class: 'StringParameterValue'],
|
|
|
|
[name: 'IOS_URL', value: ipaUrl, $class: 'StringParameterValue'],
|
|
|
|
[name: 'DMG_URL', value: dmgUrl, $class: 'StringParameterValue'],
|
|
|
|
[name: 'NIX_URL', value: appUrl, $class: 'StringParameterValue']
|
|
|
|
]
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
2018-08-29 15:39:49 +00:00
|
|
|
stage('Run e2e') {
|
|
|
|
when { expression { cmn.getBuildType() == 'nightly' } }
|
|
|
|
steps { script {
|
|
|
|
e2eApk = e2e.getBuildVariables().get('SAUCE_URL')
|
|
|
|
build(
|
|
|
|
job: 'end-to-end-tests/status-app-nightly', wait: false,
|
|
|
|
parameters: [string(name: 'apk', value: "--apk=${e2eApk}")]
|
|
|
|
)
|
|
|
|
} }
|
|
|
|
}
|
2018-08-14 18:09:52 +00:00
|
|
|
}
|
|
|
|
}
|