Question

We have around 50 projects configured in CruiseControl.net, and each is individually configured to send an email out on completion / change / whatever.

Is there any way of configuring the user / email address list at a higher (e.g. server) level? I've searched the documentation, and googled for any clues, but I can't find anything.

I need to update who gets sent emails, and updating 50 files isn't a sustainable or ideal solution!

Thanks.

Was it helpful?

Solution

I'm not sure this the exact case of yours, but might work for you too. I have separated all the email settings into separate file, and then use the include in project configuration.

So it looks sth like this:

File: EmailPublisher.xml

<cb:config-template xmlns:cb="urn:ccnet.config.builder">
<email from="notification@example.com" mailhost="mailhost.example.com" mailport="587" includeDetails="true" mailhostUsername="username" 
        mailhostPassword="mailPwd" useSSL="TRUE" replyto="admin@example.com">       

        <description>Sending email notifications</description>
    <groups>
        <group name="developers">
          <notifications>
            <notificationType>Failed</notificationType>
            <notificationType>Fixed</notificationType>
          </notifications>
        </group>
        <group name="buildmaster">
          <notifications>
            <notificationType>Always</notificationType>
          </notifications>
        </group>
    </groups>

    <converters>
        <regexConverter find="$" replace="@example.com" />
    </converters>

    <modifierNotificationTypes>
        <NotificationType>Failed</NotificationType>
        <NotificationType>Fixed</NotificationType>
    </modifierNotificationTypes>    
</email>
</cb:config-template>

And then in the project configuration in publishers section:

<!-- email publisher -->
<cb:include href="EmailPublisher.xml"/>

The downside is that you need to have the same configuration for each project, or alternatively use several include files (which starts to cause the same issue again).

Anyway, it seems to work for our team rather well.

[EDIT] You can also go one step further, and for example only include the users list from separate file, and have the notifications settings applied separately for project.

OTHER TIPS

You could use variables/substitutions like this: $(admins), $(programmers), $(ProductAScrumMaster), $(ProductBEntireTeam), $(HolyCrapTheMachineFriedEmailEveryone) and the like. You can append or nest them as well if you need combinations.

This post might be more useful as an example - it has lots more detail: Using dynamic parameters in email publisher subjectSettings block with CruiseControl.Net

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top