Tutorial :CruiseControl.net Email


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.


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)


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:


Add the following to your config

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


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.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »