Reputation: 2826
I am using jenkins as my CI server for my .Net based project. I am using MS-Build plugin to build project from jenkins. It is working as expected, it sends an email when build gets failed. Now I also want jenkins to send email when build has warning in it. I could not find any plugin which provides this functionality out of box.
So I tried to use "Extended Email Notification", "Console Output Parsing" plugins. But it does not give me expected behaviour. Currently what I have acheived is sending a mail when warning occured. I mark build as unstable using "Console output parsing" plugin and send email using e-mail notification. But e-mail does not have details about warnings.
I came across few articles where it says we can use groovy script or jelly script and "Extended Email Notification" plugin to send details. But I don't how to fetch details of warning from parsing plugin. Can someone point me to correct resources or guide me to acheive this?
Upvotes: 1
Views: 2422
Reputation: 3614
Look for
https://wiki.jenkins-ci.org/display/JENKINS/Text-finder+Plugin mark Build as "unstable" by parsing of log files. You can run downstream Jobs(if you have) also after "unstable" builds --> see job config. Status "unstable" is the "gray area" in Jenkins but has yellow color.
https://wiki.jenkins-ci.org/display/JENKINS/Notification+Plugin sends E-Mails also for "unstable" builds with text extracted from build log files.
Upvotes: 3
Reputation: 4075
Jenkins is based on the assumption that a specific build (or "run") can either be "good" or "bad", hence the two-color scheme - there is no "gray area" for that matter.
Having said that, there are plugins to allow for a third state of "unstable",
which is also supported by the triggering mechanism.
Take for example the Text-finder Plugin or the Log Parser Plugin -
both will allow you to search keywords in files you specify and use that to downgrade a 'successful' build
to 'unstable' or a 'failed'.
Upvotes: 2