Fix ignore_unstable
https://mirantis.jira.com/browse/PRODX-34267
Change-Id: Icdefea4b9b05b487ed920592a3d031d80eddcb0f
diff --git a/src/com/mirantis/mk/Workflow.groovy b/src/com/mirantis/mk/Workflow.groovy
index e4d75bf..8cc5354 100644
--- a/src/com/mirantis/mk/Workflow.groovy
+++ b/src/com/mirantis/mk/Workflow.groovy
@@ -435,6 +435,9 @@
break;
case "UNSTABLE":
ignoreStepResult = step['ignore_unstable'] ?: (step['ignore_failed'] ?: false)
+ if (ignoreStepResult && !step['skip_results'] ?: false) {
+ failed_jobs[build_url] = job_result
+ }
break;
default:
ignoreStepResult = step['ignore_failed'] ?: false
@@ -524,6 +527,7 @@
*
* job: string. Jenkins job name
* ignore_failed: bool. if true, keep running the workflow jobs if the job is failed, but fail the workflow at finish
+ * ignore_unstable: bool. if true, keep running the workflow jobs if the job is unstable, but mark the workflow is unstable at finish
* skip_results: bool. if true, keep running the workflow jobs if the job is failed, but do not fail the workflow at finish. Makes sense only when ignore_failed is set.
* ignore_not_built: bool. if true, keep running the workflow jobs if the job set own status to NOT_BUILT, do not fail the workflow at finish for such jobs
* inherit_parent_params: bool. if true, provide all parameters from the parent job to the child job as defaults
@@ -648,6 +652,8 @@
currentBuild.result = 'SUCCESS'
}
+ common.infoMsg("Workflow finished with result: ${currentBuild.result}")
+
if (slackReportChannel) {
def slack = new com.mirantis.mcp.SlackNotification()
slack.jobResultNotification(currentBuild.result, slackReportChannel, '', null, '', 'slack_webhook_url')