1
0
Fork 0

added status variables

This commit is contained in:
Christian Kühnel 2020-02-17 16:22:51 +00:00
parent a0bc500ac1
commit cbe186f02b

View file

@ -35,6 +35,10 @@ pipeline {
stage("build info"){ stage("build info"){
steps { steps {
echo "Building diff ${DIFF_ID} with PHID ${PHID}" echo "Building diff ${DIFF_ID} with PHID ${PHID}"
script {
success = true
failure_message = ""
}
} }
} }
stage("git checkout"){ stage("git checkout"){
@ -66,6 +70,14 @@ pipeline {
""" """
} }
} }
post {
failure {
script {
success = false
failure_message = "Failed to apply patch"
}
}
}
} }
stage('CMake') { stage('CMake') {
steps { steps {
@ -73,6 +85,14 @@ pipeline {
powershell "${SCRIPT_DIR}/run_cmake.ps1 -projects detect" powershell "${SCRIPT_DIR}/run_cmake.ps1 -projects detect"
} }
} }
post {
failure {
script {
success = false
failure_message = "Failed to run CMake"
}
}
}
} }
stage('ninja all') { stage('ninja all') {
steps { steps {
@ -80,6 +100,14 @@ pipeline {
powershell "${SCRIPT_DIR}/run_ninja.ps1 all" powershell "${SCRIPT_DIR}/run_ninja.ps1 all"
} }
} }
post {
failure {
script {
success = false
failure_message = "Failed to run ninja all"
}
}
}
} }
stage('ninja check-all') { stage('ninja check-all') {
steps { steps {
@ -87,10 +115,25 @@ pipeline {
powershell "${SCRIPT_DIR}/run_ninja.ps1 check-all" powershell "${SCRIPT_DIR}/run_ninja.ps1 check-all"
} }
} }
post {
failure {
script {
success = false
failure_message = "Failed to run ninja check-all"
}
}
}
} }
} }
post { post {
always { always {
script {
if (success) {
currentBuild.result = "SUCCESS"
} else {
currentBuild.result = "FAILURE"
}
}
echo "Uploading logs to ${RESULT_URL} ..." echo "Uploading logs to ${RESULT_URL} ..."
dir("${RESULT_DIR}") { dir("${RESULT_DIR}") {
// gather all result files in a folder // gather all result files in a folder
@ -115,7 +158,8 @@ pipeline {
--host "${PHABRICATOR_HOST}/api/" ^ --host "${PHABRICATOR_HOST}/api/" ^
--results-dir "${RESULT_DIR}" ^ --results-dir "${RESULT_DIR}" ^
--results-url "${RESULT_URL}" ^ --results-url "${RESULT_URL}" ^
--failures "${failure_message}" --failures "${failure_message}" ^
--buildresult ${currentBuild.result}
""" """
dir("${RESULT_DIR}") { dir("${RESULT_DIR}") {
// upload results to // upload results to