[Buildbot-devel] Mail Notifiers to different projects

Gavin gavin at 16degrees.com.au
Tue Mar 31 10:39:42 UTC 2009


Hi Ian, 

 

great, thanks very much, will try all this tomorrow.!

 

Gav.

 

  _____  

From: Ian Peters-Campbell [mailto:mahatmamanic at gmail.com] 
Sent: Tuesday, 31 March 2009 12:11 AM
To: Gavin
Cc: buildbot-devel at lists.sourceforge.net
Subject: Re: [Buildbot-devel] Mail Notifiers to different projects

 

You can definitely do something like that.  In my configuration I actually
am not only doing that, but also sending emails to different lists based on
build sucess/failure.  The code below is what I am doing...note that unless
you've modified the assertion that crashes 'passing' builds (check the BB
code) and you've created some internal difference between a release and an
integration build, this code won't work exactly as-is, but it should give
you the general idea :)


def createEmailNotifier(self, builder, baseRecipients, extraRecipients,
lookup):
        """\
        Create the mail notifier(s) for the given builder
        
        baseRecipients: generally the dev team
        extraRecipients: the release team
        lookup: email completion lookup
        """
        # release builder gets a wide-release email notifier for
        # successful builds only        
        if builder['release']:
            emailAddresses = self.users.getEmailAddresses(extraRecipients)
            notifier = ExtendedMailNotifier(self.projectTracker,
                                            self.bbReplyAddress,
                                            mode = 'passing',
                                            builders = [builder['name']],
                                            lookup = lookup,
                                            extraRecipients =
emailAddresses)
            self.notifiers.append(notifier)

        # non-release builders get a narrow-release email for successful
builds
        else:
            emailAddresses = self.users.getEmailAddresses(baseRecipients)
            notifier = MailNotifier(self.bbReplyAddress, mode = 'passing',
                                    builders = [builder['name']], lookup =
lookup,
                                    extraRecipients = emailAddresses)
            self.notifiers.append(notifier)
            
        # all builders get a narrow-release notifier for failed builds
        emailAddresses = self.users.getEmailAddresses(baseRecipients)
        notifier = MailNotifier(self.bbReplyAddress, mode = 'failing',
addLogs = True,
                                builders = [builder['name']], lookup =
lookup,
                                extraRecipients = emailAddresses)
        self.notifiers.append(notifier)



On Mon, Mar 30, 2009 at 4:46 AM, Gavin <gavin at 16degrees.com.au> wrote:

Hi All,

Just wanted to clarify whether this should work :-

from buildbot.status import mail
c['status'].append(mail.MailNotifier(fromaddr="buildbot at localhost",
                                    extraRecipients=["projectA at a.o"],
                                    sendToInterestedUsers=False,
                                    builders=["mod_perl_2_trunk"]))

c['status'].append(mail.MailNotifier(fromaddr="buildbot at localhost",
                                    extraRecipients=["projectB at a.o"],
                                    sendToInterestedUsers=False,
                                    builders=["james-server-trunk"]))

etc etc , so each project only gets notification of their own builds.

Cheers

Gav...


----------------------------------------------------------------------------
--
_______________________________________________
Buildbot-devel mailing list
Buildbot-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/buildbot-devel

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://buildbot.net/pipermail/devel/attachments/20090331/519080dd/attachment.html>


More information about the devel mailing list