Customize failure message in a build

9 views
Skip to first unread message

Adrien Ruffie

unread,
Sep 8, 2015, 4:56:36 AM9/8/15
to Jenkins Users, e.ch...@e-deal.com
Hello all,

I want to customize the failure message at the job ending (you can see it in attached file).
My problem is also, I have several "Script shell" steps in the same build, but when one of them fail, the failure job report don't specify which one failed ...
Do you know one mean to give one number in each "script shell" step in order to specify it in the failure message ?

Thank you very much and best regards.

Adrien
failure.JPG

Victor Martinez

unread,
Sep 8, 2015, 7:18:47 AM9/8/15
to Jenkins Users, e.ch...@e-deal.com
Hi,

  IMO "script shell" step should contain a few lines, and if you need further logic you might need to store those scripts in your SCM tool, then you can call that script. There are different approaches:
 
  1) You could merge those "Script shell" in one shell and use your SCM to store those scripts: then you could trap those errors and add some error messages
  2) You could use the groovy post build actions in order to manipulate those failures and add further details about those errors in the main job dashboard: https://wiki.jenkins-ci.org/display/JENKINS/Groovy+Postbuild+Plugin
  3) You could use the console parser plugin: https://wiki.jenkins-ci.org/display/JENKINS/Log+Parser+Plugin
  4) You could use the build failure plugin in order to categorize those errors and add indicators in your job: https://wiki.jenkins-ci.org/display/JENKINS/Build+Failure+Analyzer

Those plugins already describe some examples of parsing the console output.

Cheers
Reply all
Reply to author
Forward
0 new messages