Wrap code into a stage block.

This commit is contained in:
Manuele Simi 2019-12-09 16:00:42 -05:00
parent 54b0bb03de
commit ed4b6bcef0
1 changed files with 13 additions and 11 deletions

24
Jenkinsfile vendored
View File

@ -157,17 +157,19 @@ pipeline {
stage('build maven-parent') {
steps {
script {
if ( ("${resume}" == 'true') && (wasSuccess('maven-parent')) ) {
// propagate success
sh "echo -e \\\"maven-parent,SUCCESS\\\">> $JOB_REPORT"
} else {
def gjob = build(job: 'maven-parent', wait: true, propagate: true,
parameters: [[$class: 'StringParameterValue', name: 'gcube_settings', value: "${maven_parent_file}"],
[$class: 'StringParameterValue', name: 'local_repo', value: "${maven_local_repo_path}"],
[$class: 'LabelParameterValue', name: 'exec_label', label: "CD", nodeEligibility: [$class: 'AllNodeEligibility']]
])
sh "echo -e \\\"maven-parent,${gjob.getResult()}\\\">> $JOB_REPORT"
echo "Done with maven-parent"
stage('check and build') {
if ( ("${resume}" == 'true') && (wasSuccess('maven-parent')) ) {
// propagate success
sh "echo -e \\\"maven-parent,SUCCESS\\\">> $JOB_REPORT"
} else {
def gjob = build(job: 'maven-parent', wait: true, propagate: true,
parameters: [[$class: 'StringParameterValue', name: 'gcube_settings', value: "${maven_parent_file}"],
[$class: 'StringParameterValue', name: 'local_repo', value: "${maven_local_repo_path}"],
[$class: 'LabelParameterValue', name: 'exec_label', label: "CD", nodeEligibility: [$class: 'AllNodeEligibility']]
])
sh "echo -e \\\"maven-parent,${gjob.getResult()}\\\">> $JOB_REPORT"
echo "Done with maven-parent"
}
}
}
}