[feat][core] allow skipping os demo for cross-component ci
PRODX-10691
Change-Id: Ie6cefba6dd7f0ff9958caded2bd1a61ad58a27a1
diff --git a/src/com/mirantis/mk/KaasUtils.groovy b/src/com/mirantis/mk/KaasUtils.groovy
index b64b5a6..9f71199 100644
--- a/src/com/mirantis/mk/KaasUtils.groovy
+++ b/src/com/mirantis/mk/KaasUtils.groovy
@@ -487,20 +487,23 @@
parameters.addAll(additionalParameters)
}
+ def jobs = [:]
def jobResults = []
- jobs["kaas-core-openstack-patched-${component}"] = {
- try {
- common.infoMsg('Deploy: patched KaaS demo with Openstack provider')
- os_job_info = build job: "kaas-testing-core-openstack-workflow-${component}", parameters: parameters, wait: true
- def build_description = os_job_info.getDescription()
- def build_result = os_job_info.getResult()
- jobResults.add(build_result)
+ if (triggers.osDemoEnabled) {
+ jobs["kaas-core-openstack-patched-${component}"] = {
+ try {
+ common.infoMsg('Deploy: patched KaaS demo with Openstack provider')
+ os_job_info = build job: "kaas-testing-core-openstack-workflow-${component}", parameters: parameters, wait: true
+ def build_description = os_job_info.getDescription()
+ def build_result = os_job_info.getResult()
+ jobResults.add(build_result)
- if (build_description) {
- currentBuild.description += build_description
+ if (build_description) {
+ currentBuild.description += build_description
+ }
+ } finally {
+ common.infoMsg('Patched KaaS demo with Openstack provider finished')
}
- } finally {
- common.infoMsg('Patched KaaS demo with Openstack provider finished')
}
}
if (triggers.awsOnDemandDemoEnabled) {
@@ -549,6 +552,9 @@
}
common.infoMsg('Trigger KaaS demo deployments according to defined provider set')
+ if (jobs.size() == 0) {
+ error('No demo jobs matched with keywords, execution will be aborted, at least 1 provider should be enabled')
+ }
// Limit build concurency workaround examples: https://issues.jenkins-ci.org/browse/JENKINS-44085
parallel jobs