Build status depending on build failure type

24 views
Skip to first unread message

Jakub Czaplicki

unread,
Jul 8, 2015, 11:57:37 AM7/8/15
to jenkins...@googlegroups.com

I would like to be able to set a build status to "Not built" or "Aborted" when a certain failure occur (specific string in a log I suppose).

For instance when a infrastructure failure occurs: "failed receiving gdi request response for mid=2 (got syncron message receive timeout error).".

Ideally, in such case, email notification should only be sent to Jenkins admin/Test team rather than individuals who commited the change that triggered Jenkins.

What would be the best way to approach this ?

Many Thanks,
Jakub

Oleg Nenashev

unread,
Jul 13, 2015, 4:56:10 PM7/13/15
to jenkins...@googlegroups.com
The best way would be to use Conditional Build Step plugin, which sets the status using "Fail the build" plugin

среда, 8 июля 2015 г., 18:57:37 UTC+3 пользователь Jakub Czaplicki написал:

Oleg Nenashev

unread,
Jul 13, 2015, 4:57:12 PM7/13/15
to jenkins...@googlegroups.com
Upd: not a best way, just an applicable one.
Many other plugins like "Log Parser" allow to address common cases and provide a good UI for your case

понедельник, 13 июля 2015 г., 23:56:10 UTC+3 пользователь Oleg Nenashev написал:

Maciej Jaros

unread,
Jul 24, 2015, 5:42:06 AM7/24/15
to jenkins...@googlegroups.com
Jakub Czaplicki (2015-07-08 17:57):
When you catch some error you can echo something like "[ERROR] something". Just remeber to use something like `echo "[""ERROR]"` so that you won't match the code.

Then you can have a final guard that fails the build if it find "[ERROR]" and make it unstable if it finds a text "[WARNING]" (see screenshot below). Then in another post build step you can set build description based on the first matched error (example below). Probably might be more flexiable to do it with Groovy, but that method is fine if you don't have too many jobs.

Regards,
Nux.




Reply all
Reply to author
Forward
0 new messages