[refactor][core] try/catch in for parallel demo execution
us: PRODX-5353
Change-Id: I0ba6f4936c82dbe2242a2fe03cbe6cc8aa7d5d76
diff --git a/src/com/mirantis/mk/KaasUtils.groovy b/src/com/mirantis/mk/KaasUtils.groovy
index f99540e..e558131 100644
--- a/src/com/mirantis/mk/KaasUtils.groovy
+++ b/src/com/mirantis/mk/KaasUtils.groovy
@@ -214,28 +214,32 @@
def jobResults = []
jobs["kaas-core-openstack-patched-${component}"] = {
- common.infoMsg('Deploy: patched KaaS demo with Openstack provider')
- def job_info = build job: "kaas-testing-core-openstack-workflow-${component}", parameters: parameters, wait: true
- def build_description = job_info.getDescription()
- def build_result = job_info.getResult()
-
- common.infoMsg("Patched KaaS demo with Openstack provider finished with status: ${build_result}")
- jobResults.add(build_result)
- if (build_description) {
- currentBuild.description += build_description
+ try {
+ common.infoMsg('Deploy: patched KaaS demo with Openstack provider')
+ def job_info = build job: "kaas-testing-core-openstack-workflow-${component}", parameters: parameters, wait: true
+ def build_description = job_info.getDescription()
+ if (build_description) {
+ currentBuild.description += build_description
+ }
+ } finally {
+ def build_result = job_info.getResult()
+ common.infoMsg("Patched KaaS demo with Openstack provider finished with status: ${build_result}")
+ jobResults.add(build_result)
}
}
if (triggers.awsOnDemandDemoEnabled) {
jobs["kaas-core-aws-patched-${component}"] = {
- common.infoMsg('Deploy: patched KaaS demo with AWS provider')
- def job_info = build job: "kaas-testing-core-aws-workflow-${component}", parameters: parameters, wait: true
- def build_description = job_info.getDescription()
- def build_result = job_info.getResult()
-
- common.infoMsg("Patched KaaS demo with AWS provider finished with status: ${build_result}")
- jobResults.add(build_result)
- if (build_description) {
- currentBuild.description += build_description
+ try {
+ common.infoMsg('Deploy: patched KaaS demo with AWS provider')
+ def job_info = build job: "kaas-testing-core-aws-workflow-${component}", parameters: parameters, wait: true
+ def build_description = job_info.getDescription()
+ if (build_description) {
+ currentBuild.description += build_description
+ }
+ } finally {
+ def build_result = job_info.getResult()
+ common.infoMsg("Patched KaaS demo with AWS provider finished with status: ${build_result}")
+ jobResults.add(build_result)
}
}
}
@@ -245,6 +249,7 @@
parallel jobs
if (jobResults.contains('FAILURE')) {
+ common.infoMsg('One of parallel downstream jobs is failed, mark executor job as failed')
currentBuild.result = 'FAILURE'
}
}