Sid*_*rth 5 email cruisecontrol.net build ccnet-config
我使用CruiseControl.Net设置了持续集成环境.我想知道在构建失败时如何将电子邮件发送给某人.
提前致谢.
Dav*_*ght 10
您可以在<email>块中使用<publishers>块.
我们的系统看起来像这样:
<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>
Run Code Online (Sandbox Code Playgroud)
注意,我们使用<svn>源控制块来获取最新的源并触发构建.该<regexConverter>部分使用svn用户并在末尾添加"@ ourcompany.com"以形成电子邮件地址.
您将需要SMTP服务器的详细信息才能发送电子邮件.我相信可以使用gmail,但我们公司有自己的SMTP服务器.
使用此系统,"构建主人"(Mr Happy和Mr Strong)将在构建状态发生变化时收到电子邮件,任何已将代码提交到SVN的人都会在构建代码失败或修复时收到电子邮件.
<xmllogger/>默认情况下该部分是必需的(如果没有<publishers>部分),则有一个XML记录器发布者.这会记录Web界面的信息.