Jenkins: Attempt to streamline failure state
This commit is contained in:
18
.ci/Jenkinsfile
vendored
18
.ci/Jenkinsfile
vendored
@@ -84,8 +84,6 @@ def presetFlags = [
|
|||||||
'Dev': '--preset=experimental -D CMAKE_BUILD_TYPE=Debug -D VNC=OFF'
|
'Dev': '--preset=experimental -D CMAKE_BUILD_TYPE=Debug -D VNC=OFF'
|
||||||
]
|
]
|
||||||
|
|
||||||
def anyFailure = false
|
|
||||||
|
|
||||||
def gitClone(repository, branch) {
|
def gitClone(repository, branch) {
|
||||||
/* Clean workspace. */
|
/* Clean workspace. */
|
||||||
cleanWs()
|
cleanWs()
|
||||||
@@ -135,11 +133,8 @@ def runBuild(args) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
def failStage() {
|
def failStage() {
|
||||||
/* Mark that a failure occurred. */
|
|
||||||
anyFailure = true
|
|
||||||
|
|
||||||
/* Force this stage to fail. */
|
/* Force this stage to fail. */
|
||||||
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
|
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
|
||||||
def x = 1 / 0
|
def x = 1 / 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -238,7 +233,7 @@ pipeline {
|
|||||||
presets.each { preset ->
|
presets.each { preset ->
|
||||||
def combination = "$os $arch $dynarec $preset"
|
def combination = "$os $arch $dynarec $preset"
|
||||||
combinations[combination] = {
|
combinations[combination] = {
|
||||||
try {
|
catchError(buildResult: 'FAILURE', stageResult: 'SUCCESS') {
|
||||||
retry(10) {
|
retry(10) {
|
||||||
node(os) {
|
node(os) {
|
||||||
stage(combination) {
|
stage(combination) {
|
||||||
@@ -268,9 +263,6 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
|
||||||
/* Fail this stage. */
|
|
||||||
failStage()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -286,12 +278,6 @@ pipeline {
|
|||||||
post {
|
post {
|
||||||
always {
|
always {
|
||||||
script {
|
script {
|
||||||
/* Mark build as failed if any step has failed. */
|
|
||||||
if (anyFailure) {
|
|
||||||
println "[!] Failing build because a build stage failed"
|
|
||||||
currentBuild.result = 'FAILURE'
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Send out build notifications. */
|
/* Send out build notifications. */
|
||||||
if (!env.JOB_BASE_NAME.contains('TestBuildPleaseIgnore')) {
|
if (!env.JOB_BASE_NAME.contains('TestBuildPleaseIgnore')) {
|
||||||
try {
|
try {
|
||||||
|
Reference in New Issue
Block a user