问题
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