- println("TEST_INSTALL = ${params.TEST_INSTALL}, downstream job: ${downstream_job_name}")
-
- stage_3_merge_result = build job: "${downstream_job_name}", parameters: downstream_params, propagate: true
- if (stage_3_merge_result.getResult() != 'SUCCESS') {
- project = stage_3_merge_result.getProjectName()
- build = stage_3_merge_result.getNumber()
- error("${project} build ${build} failed")
+ println("Downstream job: ${downstream_job_name}")
+ println("Downstream parameters: ${downstream_params}")
+ currentBuild.result = 'SUCCESS'
+ try {
+ stage_3_merge_result = build job: "${downstream_job_name}", parameters: downstream_params, propagate: true
+ if (stage_3_merge_result.getResult() != 'SUCCESS') {
+ project = stage_3_merge_result.getProjectName()
+ build = stage_3_merge_result.getNumber()
+ // Jayant if the build fails the below error will cause the pipeline to terminate.
+ // error("${project} build ${build} failed")
+ currentBuild.result = stage_3_merge_result.getResult()
+ }
+ }
+ catch(caughtError) {
+ echo 'Exception in stage_1'
+ currentBuild.result = 'FAILURE'