split catcherror in order to manage differents cases

This commit is contained in:
Roberto Cirillo 2024-10-30 15:46:28 +01:00
parent 4ab3535e90
commit c9af197c68
1 changed files with 10 additions and 6 deletions

16
Jenkinsfile vendored
View File

@ -203,10 +203,12 @@ pipeline {
echo '\033[31;1;4mNew upstream deploy ongoing\033[0m'
echo "Cron build disabled. Component: ${params.TRIGGER_JOB} - ${params.TRIGGER_VERSION}"
ansiColor('xterm') {
catchError(buildResult: 'UNSTABLE', stageResult: 'UNSTABLE') {
checkup("${params.TRIGGER_JOB}", "${params.TRIGGER_VERSION}", "${params.TRIGGER_HOST}");
deploy("${params.TRIGGER_JOB}", "${params.TRIGGER_VERSION}", "${params.TRIGGER_HOST}", "${params.TRIGGER_FOO}");
}
catchError(buildResult: 'UNSTABLE', stageResult: 'UNSTABLE') {
checkup("${params.TRIGGER_JOB}", "${params.TRIGGER_VERSION}", "${params.TRIGGER_HOST}");
}
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
deploy("${params.TRIGGER_JOB}", "${params.TRIGGER_VERSION}", "${params.TRIGGER_HOST}", "${params.TRIGGER_FOO}");
}
}
}
@ -332,10 +334,12 @@ def deployJobs(def serviceList){
service=record.split(",");
stage(service[0]){
println("Processing deploy: "+service[ 0 ])
// catchError(buildResult: 'UNSTABLE', stageResult: 'UNSTABLE') {
catchError(buildResult: 'UNSTABLE', stageResult: 'UNSTABLE') {
checkup(service[0], service[ 1 ], service[2]);
}
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
deploy(service[0], service[ 1 ], service[2]);
// }
}
}
}