Email alert when build fails in CruiseControl.Net
I have setup a Continuous Integration environment using CruiseControl.Net. I want to know how an email can be sent to a person at the time of a b开发者_开发技巧uild failure.
Thanks in Advance.
You can use an <email>
block within your <publishers>
block.
Our system looks like this:
<publishers>
<xmllogger />
<email from="cruise@ourcompany.com" mailhost="mail.ourcompany.com" includeDetails="TRUE" mailport="25" useSSL="FALSE">
<users>
<user name="Mr Happy" group="buildmaster" address="mrhappy@ourcompany.com" />
<user name="Mr Strong" group="buildmaster" address="mrstrong@ourcompany.com" />
</users>
<groups>
<group name="buildmaster" notification="change" />
</groups>
<converters>
<regexConverter find="$" replace="@ourcompany.com" />
</converters>
<modifierNotificationTypes>
<NotificationType>Failed</NotificationType>
<NotificationType>Fixed</NotificationType>
</modifierNotificationTypes>
</email>
</publishers>
NB, we use an <svn>
source control block to get latest source and trigger a build. The <regexConverter>
section takes the svn user and adds "@ourcompany.com" to the end to form an email address.
You will need the details for an SMTP server to send the email. I believe it is possible to use gmail for this, but our company has its own SMTP server.
With this system, the "build masters" (Mr Happy and Mr Strong) will get an email whenever the build status changes, and anyone who has committed code into SVN will get an email when the build their code causes fails or is fixed.
The <xmllogger/>
section is necessary as by default (if you have no <publishers>
section), there is an XML logger publisher. This logs the information for the web interface.
精彩评论