phase1: implement IRC notifications
[buildbot.git] / phase1 / master.cfg
index c06b15f2134c6fb93cf77f14ed35d2a9f91dfc5f..69f3b7870348d7aa11dc79900e9c10ec55ed8e85 100644 (file)
@@ -493,6 +493,34 @@ if ini.has_option("status", "bind"):
        else:
                c['status'].append(html.WebStatus(http_port=ini.get("status", "bind")))
 
+
+from buildbot.status import words
+
+if ini.has_option("irc", "host") and ini.has_option("irc", "nickname") and ini.has_option("irc", "channel"):
+       irc_host = ini.get("irc", "host")
+       irc_port = 6667
+       irc_chan = ini.get("irc", "channel")
+       irc_nick = ini.get("irc", "nickname")
+       irc_pass = None
+
+       if ini.has_option("irc", "port"):
+               irc_port = ini.getint("irc", "port")
+
+       if ini.has_option("irc", "password"):
+               irc_pass = ini.get("irc", "password")
+
+       irc = words.IRC(irc_host, irc_nick, port = irc_port, password = irc_pass,
+                       channels = [{ "channel": irc_chan }],
+                       notify_events = {
+                         'exception': 1,
+                         'successToFailure': 1,
+                         'failureToSuccess': 1
+                       }
+       )
+
+       c['status'].append(irc)
+
+
 ####### PROJECT IDENTITY
 
 # the 'title' string will appear at the top of this buildbot