Skip all the jobs if resume is enabled && success.

This commit is contained in:
Manuele Simi 2019-12-09 21:37:23 -05:00
parent b2324d2fad
commit 5c120a3207
1 changed files with 10 additions and 2 deletions

12
Jenkinsfile vendored
View File

@ -233,12 +233,20 @@ def buildComponents(args, maven_settings_file, maven_local_repo_path) {
if (args.items) {
parallel args.items?.collectEntries { name ->
["${name}": {
if (name && !"NONE".equalsIgnoreCase(name))
build(job: name,
if (name && !"NONE".equalsIgnoreCase(name)) {
if ( ("${resume}" == 'true') && (jobs["${name}"] == 'SUCCESS') ) {
echo "Skipping ${name}"
// propagate success
sh "echo -e \\\"${name},SUCCESS\\\">> $JOB_REPORT"
} else {
build(job: name,
parameters: [[$class: 'StringParameterValue', name: 'gcube_settings', value: "${maven_settings_file}"],
[$class: 'StringParameterValue', name: 'local_repo', value: "${maven_local_repo_path}"],
[$class: 'LabelParameterValue', name: 'exec_label', label: "CD", nodeEligibility: [$class: 'AllNodeEligibility']]
])
sh "echo -e \\\"${name},${gjob.getResult()}\\\">> $JOB_REPORT"
}
}
}
]
}