1
0
Fork 0

Don't fail buildif ninja all / check all has failed

This commit is contained in:
Mikhail Goncharov 2019-12-18 08:57:29 +01:00
parent a6bfda48f8
commit 89e7c8ad24

View file

@ -33,6 +33,7 @@ pipeline {
steps { steps {
echo "Building diff ${DIFF_ID} with PHID ${PHID}" echo "Building diff ${DIFF_ID} with PHID ${PHID}"
script { script {
def success = true
def revision_phid = sh(script: def revision_phid = sh(script:
'echo \'{"constraints":{"ids":[' + DIFF_ID + ']}}\' | '+ 'echo \'{"constraints":{"ids":[' + DIFF_ID + ']}}\' | '+
'arc call-conduit --conduit-uri=$PHABRICATOR_HOST --conduit-token $CONDUIT_TOKEN differential.diff.search | ' + 'arc call-conduit --conduit-uri=$PHABRICATOR_HOST --conduit-token $CONDUIT_TOKEN differential.diff.search | ' +
@ -76,12 +77,26 @@ pipeline {
} }
stage('ninja all') { stage('ninja all') {
steps { steps {
sh "${SCRIPT_DIR}/run_ninja.sh all" script {
try {
sh(script: "${SCRIPT_DIR}/run_ninja.sh all")
} catch (e) {
success = false;
echo e.toString()
}
}
} }
} }
stage('ninja check-all') { stage('ninja check-all') {
steps { steps {
sh "${SCRIPT_DIR}/run_ninja.sh check-all" script {
try {
sh(script: "${SCRIPT_DIR}/run_ninja.sh check-all")
} catch (e) {
success = false;
echo e.toString()
}
}
} }
} }
stage('linters') { stage('linters') {
@ -92,7 +107,13 @@ pipeline {
} }
post { post {
always { always {
script {
if (success) {
currentBuild.result = "SUCCESS"
} else {
currentBuild.result = "FAILURE"
}
}
echo "Console log is available at ${RESULT_URL}" echo "Console log is available at ${RESULT_URL}"
dir("${TARGET_DIR}") { dir("${TARGET_DIR}") {
// copy console log to result folder // copy console log to result folder