I want to access the log of another post-build action, which runs right before the groovy postbuild.
The console output looks like this:
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:00.48
Code Metrics Report path: **/*.Metrics.xml
Code Metrics Report Not Found.
Build step 'Record VS Code Metrics PowerTool Report' changed build result to UNSTABLE
I cannot use manager.logContains()
because the output was generated by another post-build action.
I can set the build status to SUCCESS, but I want to do it only if the post-build action logged Build step 'Record VS Code Metrics PowerTool Report' changed build result to UNSTABLE
if (manager.build.result == hudson.model.Result.UNSTABLE
&& ???.contains("Build step 'Record VS Code Metrics PowerTool Report' changed build result to UNSTABLE") {
manager.build.@result = hudson.model.Result.SUCCESS
}