CruiseControl.NET email publisher problem

拈花ヽ惹草 提交于 2019-11-30 15:28:38

I believe that this does what you want (admittedly, a year after your question).

NB: We use SVN, with a <svn> block. In CC.NET 1.4.xx, <email> blocks support regular expressions to work out email addresses from SVN usernames. It should work with other source control blocks, but I haven't used anything but SVN.

We have something like the following in our <publishers> block (I've modified it to match your spec):

<email ... includeDetails="true">
  <!-- Developers get an email whenever the build status changes -->
  <users>
    <user name="Dev1" group="developer" address="dev1@ourcompany.com" />
    <user name="Dev2" group="developer" address="dev2@ourcompany.com" />
  </users>
  <groups>
    <group name="developer" notification="change" />
  </groups>

  <!-- Committers get an email for every build they commit code for -->
  <converters>
    <regexConverter find="$" replace="@ourcompany.com" />
  </converters>
  <modifierNotificationTypes>
    <NotificationType>always</NotificationType>
  </modifierNotificationTypes>
</email>

So, dev1@ourcompany.com and dev2@ourcompany.com will get an email whenever the build status changes, and [svnuser]@ourcompany.com will get an email when the build they've committed code for finishes building.

NB: if the build fails, svn users who have committed code since it last succeeded will continue to get further emails each time a build finishes until the build is fixed.

I think this does what you want... we're running version 1.4.3 so YMMV. Devs get emails only when there is a change in fixed/failed status, while the PM gets an email every time there's a build.

<groups>
   <group name="Always">
        <name>Always</name>
        <notification>Always</notification>
    </group>
    <group name="developers">
        <name>developers</name>
        <notification>Change</notification>
    </group>
</groups>
<users>
    <user name="dev1">
        <address>...</address>
        <group>developers</group>
        <name>...</name>
    </user>
    <user name="pm1">
        <address>...</address>
        <group>Always</group>
        <name>...</name>
    </user>
    <user name="dev2">
        <address>...</address>
        <group>developers</group>
        <name>...</name>
    </user>
    <user name="dev3">
        <address>...</address>
        <group>developers</group>
        <name>...</name>
    </user>
</users>
<email from="CruiseControlBuild@xxxxxxxx.com" mailhost="xxxxxxxx.com" includeDetails="True">
            <users>
                <user name="Dev Staff" group="group1" address="xxxxxxxxxxx"/>
                <user name="QA Staff" group="group1" address="xxxxxxxxxxx"/>
            </users>
            <groups>
                <group name="group1" notification="always"/>
            </groups>
            <modifierNotificationTypes>
                <NotificationType>Always</NotificationType>
            </modifierNotificationTypes>
        </email>

This works, but be careful. Sending every developer an email for every build in a continuous system is begging to have your emails ignored. The only email I send to everyone is the nightly installer build.

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