CruiseControl.net Email

有些话、适合烂在心里 提交于 2019-12-12 21:04:28

问题


We have CruiseControl doing nightly builds for us. If the nightly build fails it sends out an email. The programmer will fix the problem check in his/her changes then do a force build. If the build fails then an email is sent again. Is there a way to not send email when a force build is pressed.


回答1:


I don't think it is possible in 1.4. But, it should be possible in 1.5 with the new tag "dynamicvalues" for the Email publisher.

This tag should have two variables you may be able to check. Since it hasn't been fully released, I can only speculate what might work for your specific needs.

Possible Tags:

  1. CCNetRequestSource = IntervalTrigger for you (this would only email if the interval trigger was the cause of the build)
  2. CCNetBuildCondion = IfModificationExists (this might ignore forced builds)

Example:

Your config will eventually have something similar to this in the email publisher:

<email>
...
<dynamicValues>
  <directValue>
    <property>buildArgs</property>
    <parameter>BuildArgs</parameter>
    <default>-t:$[$CCNetRequestSource|IntervalTrigger]</default>
  </directValue>
</dynamicValues>
...
</email>

CruiseControl.NET version 1.5 is already CTP. So, it will be soon.

Link Heaven:

  • http://confluence.public.thoughtworks.org/display/CCNET/Email+Publisher
  • http://confluence.public.thoughtworks.org/display/CCNET/Dynamic+Parameters



回答2:


Add the following to your config

<modifierNotificationTypes>
    <NotificationType>Change</NotificationType>
</modifierNotificationTypes>



回答3:


Now I'm using some kind of workaround:

<triggers>
  <parameterTrigger>
    <trigger type="scheduleTrigger">
      <time>01:00</time>
      <buildCondition>ForceBuild</buildCondition>
    </trigger>
    <parameters>
      <namedValue name="SmtpServer" value="smtp.mail.com"/>
    </parameters>        
  </parameterTrigger>
</triggers>

<publishers>      
  <email mailhost="fake" from="night.builder@mail.com" includeDetails="true" mailhostUsername="night.builder" mailhostPassword="xxx" useSSL="FALSE">
    <dynamicValues>
      <directValue property="mailhost" parameter="SmtpServer" default="fake" />
    </dynamicValues>        
  </email>
</publishers>

I tried to use No element from Email Publisher, but with no success.

If someone has more proper solution, please share it here.



来源:https://stackoverflow.com/questions/1143425/cruisecontrol-net-email

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!