From 20a52c8dee414e89dba49f4a4a12e20d6555c55e Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 16 Dec 2015 14:29:46 +0100 Subject: m 3 buildbot/master: make irc configurable --- makefu/3modules/buildbot/master.nix | 66 +++++++++++++++++++++++++++++-------- 1 file changed, 52 insertions(+), 14 deletions(-) (limited to 'makefu/3modules') diff --git a/makefu/3modules/buildbot/master.nix b/makefu/3modules/buildbot/master.nix index d8e917a2..5d340f89 100644 --- a/makefu/3modules/buildbot/master.nix +++ b/makefu/3modules/buildbot/master.nix @@ -81,17 +81,19 @@ let c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg)) from buildbot.status import words - # TODO: configure IRC Bot - irc = words.IRC("irc.freenode.net", "krebsbuild", - channels=["krebs"], - notify_events={ - 'success': 1, - 'failure': 1, - 'exception': 1, - 'successToFailure': 1, - 'failureToSuccess': 1, - },allowForce=True) - c['status'].append(irc) + ${optionalString (cfg.irc.enable) '' + irc = words.IRC("${cfg.irc.server}", "krebsbuild", + # TODO: multiple channels + channels=["${cfg.irc.channel}"], + notify_events={ + 'success': 1, + 'failure': 1, + 'exception': 1, + 'successToFailure': 1, + 'failureToSuccess': 1, + }${optionalString cfg.irc.allowForce ",allowForce=True"}) + c['status'].append(irc) + ''} ####### PROJECT IDENTITY c['title'] = "Stockholm" @@ -119,7 +121,42 @@ let Will be created on startup. ''; }; - + irc = mkOption { + default = {}; + type = types.submodule ({ config, ... }: { + options = { + enable = mkEnableOption "Buildbot Master IRC Status"; + channel = mkOption { + default = "nix-buildbot-meetup"; + type = types.str; + description = '' + irc channel the bot should connect to + ''; + }; + allowForce = mkOption { + default = false; + type = types.bool; + description = '' + Determines if builds can be forced via IRC + ''; + }; + nick = mkOption { + default = "nix-buildbot"; + type = types.str; + description = '' + nickname for IRC + ''; + }; + server = mkOption { + default = "irc.freenode.net"; + type = types.str; + description = '' + Buildbot Status IRC Server to connect to + ''; + }; + }; + }); + }; extraConfig = mkOption { default = ""; type = types.lines; @@ -149,7 +186,6 @@ let serviceConfig = let workdir="${lib.shell.escape cfg.workDir}"; in { - pidfile="${workdir}/twistd.pid"; PermissionsStartOnly = true; Type = "forking"; PIDFile = "${workdir}/twistd.pid"; @@ -166,9 +202,11 @@ let # sanity ${buildbot}/bin/buildbot checkconfig ${workdir} - # TODO: maybe upgrade? + # TODO: maybe upgrade? not sure about this + # normally we should write buildbot.tac by our own # ${buildbot}/bin/buildbot upgrade-master ${workdir} + chmod 700 -R ${workdir} chown buildbotMaster:buildbotMaster -R ${workdir} ''; ExecStart = "${buildbot}/bin/buildbot start ${workdir}"; -- cgit v1.2.3