Skip making of commit if nothing changed
In some cases keys values can be unchanged after update procedure,
the method shouldn't fail in this case.
Related-Prod: https://mirantis.jira.com/browse/PRODX-3685
Change-Id: Ia445242ef7395e5b8f1d7b3de1ae56cb6770c491
diff --git a/src/com/mirantis/mk/ReleaseWorkflow.groovy b/src/com/mirantis/mk/ReleaseWorkflow.groovy
index 8cb0f51..1302bbe 100644
--- a/src/com/mirantis/mk/ReleaseWorkflow.groovy
+++ b/src/com/mirantis/mk/ReleaseWorkflow.groovy
@@ -152,6 +152,14 @@
}
}
+ String status = sh(script: "git -C ${repoDir} status -s", returnStdout: true).trim()
+ if (!status){
+ common.warningMsg('All values seem up to date, nothing to update')
+ return
+ }
+ common.infoMsg("""Next files will be updated:
+ ${status}
+ """)
commitMessage =
"""${comment}
@@ -169,7 +177,6 @@
}
}
-
//commit change
git.commitGitChanges(repoDir, commitMessage, changeAuthorEmail, changeAuthorName, false)
//post change