Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configure CC.NET email notification & show error log in dashboard

I'm trying to configure CC.NET to send email notifications. I have googled a lot about it and found examples also but by using those examples I'm not able to figure out where the actual problem is occuring.

Below is the block of code I'm using it in config file:

<publishers>
        <statistics />
        <xmllogger logDir="c:\TestCC\buildlogs" />
        <email from="[email protected]" mailhost="smtp.gmail.com" mailport="587" useSSL="TRUE" mailhostUsername="[email protected]" includeDetails="TRUE" >
            <users>
                <user name="Radha" group="buildmaster" address="[email protected]" />
                <user name="Mehul" group="developers" address="[email protected]" />
            </users>
            <groups>
                <group name="developers" notifications="always" />
                <group name="buildmaster" notifications="always" />
            </groups>
        </email>
    </publishers>

The above config is passing in CC.NET config validator. How to configure it from scratch? I also want to show error logs in the Dashboard if the build is failing. I'm using nant script for building files.

like image 369
mehul9595 Avatar asked Jan 22 '23 08:01

mehul9595


1 Answers

You have the documentation for the email puiblisher here : http://confluence.public.thoughtworks.org/display/CCNET/Email+Publisher It is up-to-date and explains a lot.

From what I see in your configuration block, it lacks the mailhostPassword. And since CC.net 1.4 the notifications must be declared as follow :

<group name="developers"> 
  <notifications>
    <notificationType>Always</notificationType>
  </notifications>
</group>

Concerning the content of the dashboard and email, you can edit it by modifying the list of xsl files in dashboard.config and ccservice.exe.config. More information here :

Cruise Control .Net not showing Nant build errors

Hope this helps

EDIT
I think your conf would look like that (with gmail smtp) :

<publishers>
    <statistics />
    <xmllogger />
    <email from="[email protected]" mailhost="smtp.gmail.com" mailport="587" useSSL="TRUE" mailhostUsername="[email protected]" includeDetails="TRUE" mailhostPassword="YourGmailP@ssword" >
        <users>
            <user name="Radha" group="buildmaster" address="[email protected]" />
            <user name="Mehul" group="developers" address="[email protected]" />
        </users>
        <groups>
            <group name="developers">
              <notifications>
                <notificationType>Always</notificationType>
              </notifications>
            </group>
            <group name="buildmaster">
              <notifications>
                <notificationType>Always</notificationType>
              </notifications>
            </group>
        </groups>
    </email>
</publishers>

if you have a smtp server in your company, let's say MailServerName the first line should be

<email from="[email protected]" mailhost="MailServerName" mailhostUsername="[email protected]" mailhostPassword="YourCompanyMailP@ssword" includeDetails="TRUE" >

>

like image 108
Benjamin Baumann Avatar answered Feb 09 '23 03:02

Benjamin Baumann