From: Jo-Philipp Wich Date: Fri, 27 May 2016 12:39:24 +0000 (+0200) Subject: phase1: implement IRC notifications X-Git-Tag: v1~267 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=673d44edbf8d84eb84e7403f11577055a2681dc5;p=buildbot.git phase1: implement IRC notifications Signed-off-by: Jo-Philipp Wich --- diff --git a/phase1/config.ini.example b/phase1/config.ini.example index 005b781..de77ecc 100644 --- a/phase1/config.ini.example +++ b/phase1/config.ini.example @@ -9,6 +9,13 @@ bind = tcp:8010:interface=127.0.0.1 user = example password = example +[irc] +host = irc.freenode.net +port = 6667 +channel = #example-channel +nickname = example-builder +password = example + [repo] url = https://git.lede-project.org/source.git diff --git a/phase1/master.cfg b/phase1/master.cfg index c06b15f..69f3b78 100644 --- a/phase1/master.cfg +++ b/phase1/master.cfg @@ -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