Manoj Attal
Manoj Attal

Reputation: 2826

Send e-mail notification from jenkins when warning occurs in ms-build

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

Answers (2)

es cologne
es cologne

Reputation: 3614

Look for

Upvotes: 3

Gonen
Gonen

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

Related Questions