summaryrefslogtreecommitdiffstats
path: root/makefu/3modules/buildbot/master.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2015-12-15 22:25:46 +0100
committermakefu <github@syntax-fehler.de>2015-12-15 22:25:46 +0100
commita907f926c120f10945c47cdaba7405fe08cfd9ee (patch)
treecc13086ff19fd4417b118888cc977f4d8939f751 /makefu/3modules/buildbot/master.nix
parentcf5a1ba6bcf657396bc6b8c2fbc32143d27849d0 (diff)
m 3 buildbot: first working commit for buildbot master
Diffstat (limited to 'makefu/3modules/buildbot/master.nix')
-rw-r--r--makefu/3modules/buildbot/master.nix37
1 files changed, 23 insertions, 14 deletions
diff --git a/makefu/3modules/buildbot/master.nix b/makefu/3modules/buildbot/master.nix
index 310b8460d..d8e917a21 100644
--- a/makefu/3modules/buildbot/master.nix
+++ b/makefu/3modules/buildbot/master.nix
@@ -12,7 +12,8 @@ let
c['slaves'] = []
# TODO: template potential buildslaves
# TODO: set password?
- for i in [ 'testslave' ]:
+ slavenames= [ 'testslave' ]
+ for i in slavenames:
c['slaves'].append(buildslave.BuildSlave(i, "krebspass"))
c['protocols'] = {'pb': {'port': 9989}}
@@ -56,7 +57,7 @@ let
c['builders'].append(
util.BuilderConfig(name="runtests",
# TODO: only some slaves being used in builder?
- slavenames=c['slaves'],
+ slavenames=slavenames,
factory=factory))
####### Status of Builds
@@ -84,7 +85,7 @@ let
irc = words.IRC("irc.freenode.net", "krebsbuild",
channels=["krebs"],
notify_events={
- 'sucess': 1,
+ 'success': 1,
'failure': 1,
'exception': 1,
'successToFailure': 1,
@@ -145,26 +146,34 @@ let
description = "Buildbot Master";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
- serviceConfig = {
+ serviceConfig = let
+ workdir="${lib.shell.escape cfg.workDir}";
+ in {
+ pidfile="${workdir}/twistd.pid";
PermissionsStartOnly = true;
+ Type = "forking";
+ PIDFile = "${workdir}/twistd.pid";
# TODO: maybe also prepare buildbot.tac?
ExecStartPre = pkgs.writeScript "buildbot-master-init" ''
#!/bin/sh
set -efux
- workdir=${lib.shell.escape cfg.workDir}
- if [ ! -e $workdir ];then
- mkdir -p $workdir
- ${buildbot}/bin/buildbot create-master -r -l 10 -f $workdir
- chown buildbotMaster:buildbotMaster $workdir
+ if [ ! -e ${workdir} ];then
+ mkdir -p ${workdir}
+ ${buildbot}/bin/buildbot create-master -r -l 10 -f ${workdir}
fi
# always override the master.cfg
- cp ${toString buildbot-master-config} "$workdir/master.cfg"
+ cp ${buildbot-master-config} ${workdir}/master.cfg
# sanity
- ${buildbot}/bin/buildbot checkconfig $workdir
- # upgrade
- ${buildbot}/bin/buildbot upgrade-master $workdir
+ ${buildbot}/bin/buildbot checkconfig ${workdir}
+
+ # TODO: maybe upgrade?
+ # ${buildbot}/bin/buildbot upgrade-master ${workdir}
+
+ chown buildbotMaster:buildbotMaster -R ${workdir}
'';
- ExecStart = "${buildbot}/bin/buildbot ${lib.shell.escape cfg.workDir}";
+ ExecStart = "${buildbot}/bin/buildbot start ${workdir}";
+ ExecStop = "${buildbot}/bin/buildbot stop ${workdir}";
+ ExecReload = "${buildbot}/bin/buildbot reconfig ${workdir}";
PrivateTmp = "true";
User = "buildbotMaster";
Restart = "always";