Jenkins: Post build actions on conditions

天涯浪子 提交于 2019-12-11 03:08:53

问题


I want to run some post build actions in my Jenkins job on condition if a string or a regular expression is present in the console log. Any plugin available to do this?


回答1:


One solution is to use the LogParser plugin and to create some regexp rules to parse your log.

This plugin can change the build status to Unstable:

Next, you create a downstream job and you will use the Parameterized Trigger plugin to pass the build status from the upstream to the downstream job.

If the status is unstable (= the LogParser find something), then you will execute some specific post build actions.

You can use the Conditional BuildStep plugin to condition the downstream build step according to the upstream build status.



来源:https://stackoverflow.com/questions/30648224/jenkins-post-build-actions-on-conditions

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!