[LogParserPublisher] pipeline doesn't set currentBuild.result

197 views
Skip to first unread message

jer...@bodycad.com

unread,
Aug 19, 2016, 10:05:55 AM8/19/16
to Jenkins Users
Hi,

I have a build where I use the following:
step([$class: 'LogParserPublisher', parsingRulesPath: "QmlScriptWalker.txt", useProjectRule: false, failBuildOnError: true]);

The warnings detected doesn't set the currentBuild.result variable as unstable even if failBuildOnError is set to true. Is there a way to fetch the parsing results?

Can I suggest the following instead of the bool failBuildOnError, to use string or enum for build status:
buildStatusOnError: 'FAILURE'
buildStatusOnWarning: 'UNSTABLE'

step([$class: 'LogParserPublisher', parsingRulesPath: "QmlScriptWalker.txt", useProjectRule: false, buildStatusOnError: 'FAILURE', buildStatusOnWarning: 'UNSTABLE']);

I would love to also have teh option to only parse a stage part of the log and not the whole log in the end (cannot make multiple pass of those, only the last result is kept).

def returnedOutput = bat([returnStdout: true, script: '...']); // or sh()
step([$class: 'LogParserPublisher', parsingRulesPath: "QmlScriptWalker.txt", useProjectRule: false, buildStatusOnError: "FAILURE", buildStatusOnWarning: "UNSTABLE", log: returnedOutput, name: "QmlScriptInspection"]);

new parameter
  1. log: add the parsing of the given string (would be even better to have the console output of the current stage only, but I would settle with that just fine).
  2. name: give the parsed results name to have multiple one into the build results. 
Those would avoid having a melting pot of the parsing at the end of the node grouped all together and parsing big chunk of unrelated console output for other stage part (like the long build console output for example).

What do you think?
Jerome

jer...@bodycad.com

unread,
Aug 19, 2016, 10:07:20 AM8/19/16
to Jenkins Users
If the log is null (default value) use the normal full consoleOutput.
Reply all
Reply to author
Forward
0 new messages