我可以根据构建结果有条件地将文件附加到 CC.NET 状态电子邮件吗?
我们会发送有关任何构建状态的电子邮件。如果构建失败,我想执行以下任一操作:
- 发送一封带有附件的附加电子邮件
- 有条件地将文件附加到电子邮件
任一方法都适合我,但我认为第二个选项更好。
我怎样才能在 CC.NET 配置文件中做到这一点?
我可以有两个部分 - 一个部分与另一个部分
也许是我想要的,但我找不到这样的例子。
现在配置文件如下所示:
<publishers>
<buildpublisher>
<sourceDir>...</sourceDir>
<publishDir>...</publishDir>
</buildpublisher>
<buildpublisher>
<sourceDir>...</sourceDir>
<publishDir>...</publishDir>
</buildpublisher>
<xmllogger />
<email from="..." mailhost="..." mailhost Username="..." includeDetails="True">
<users>
<user name="..." group="..." address="..."/>
</users>
<groups>
<group name="buildstatus" notification="Always" />
</groups>
<xslFiles>
<file>xsl\header.xsl</file>
<file>xsl\modifications.xsl</file>
</xslFiles>
</email>
我想我应该添加
<onfailure>
<attachments>
<file>...</file>
</attachments>
</onfailure>
我正在寻找一些配置的明确示例,该示例显示发布者发送带有归档构建附件的电子邮件。
We send out emails for any build status. If the build fails I want to either:
- send an additional email with an attachment
- conditionally attach an file to the email
Either one works for me, but the second option is better I think.
How can I do that in the CC.NET config file?
Can I have two sections - one with and another with
Perhaps is what I want, but I can't find an example of that.
Right now the config file looks like:
<publishers>
<buildpublisher>
<sourceDir>...</sourceDir>
<publishDir>...</publishDir>
</buildpublisher>
<buildpublisher>
<sourceDir>...</sourceDir>
<publishDir>...</publishDir>
</buildpublisher>
<xmllogger />
<email from="..." mailhost="..." mailhost Username="..." includeDetails="True">
<users>
<user name="..." group="..." address="..."/>
</users>
<groups>
<group name="buildstatus" notification="Always" />
</groups>
<xslFiles>
<file>xsl\header.xsl</file>
<file>xsl\modifications.xsl</file>
</xslFiles>
</email>
I am guessing I should add
<onfailure>
<attachments>
<file>...</file>
</attachments>
</onfailure>
I'm looking for a definitive example of some configuration that shows a publisher sending an email with an attachment for a filed build.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从 ccnet 1.5 开始,您拥有条件发布者:
http://confluence.public.thoughtworks.org/display/CCNET/Conditional+发布者
from ccnet 1.5 onwards , you have the conditional publisher :
http://confluence.public.thoughtworks.org/display/CCNET/Conditional+Publisher