m 3 buildbot: first working commit for buildbot master
This commit is contained in:
parent
c4fffa3c81
commit
22f07cdae9
|
@ -12,7 +12,8 @@ let
|
||||||
c['slaves'] = []
|
c['slaves'] = []
|
||||||
# TODO: template potential buildslaves
|
# TODO: template potential buildslaves
|
||||||
# TODO: set password?
|
# TODO: set password?
|
||||||
for i in [ 'testslave' ]:
|
slavenames= [ 'testslave' ]
|
||||||
|
for i in slavenames:
|
||||||
c['slaves'].append(buildslave.BuildSlave(i, "krebspass"))
|
c['slaves'].append(buildslave.BuildSlave(i, "krebspass"))
|
||||||
|
|
||||||
c['protocols'] = {'pb': {'port': 9989}}
|
c['protocols'] = {'pb': {'port': 9989}}
|
||||||
|
@ -56,7 +57,7 @@ let
|
||||||
c['builders'].append(
|
c['builders'].append(
|
||||||
util.BuilderConfig(name="runtests",
|
util.BuilderConfig(name="runtests",
|
||||||
# TODO: only some slaves being used in builder?
|
# TODO: only some slaves being used in builder?
|
||||||
slavenames=c['slaves'],
|
slavenames=slavenames,
|
||||||
factory=factory))
|
factory=factory))
|
||||||
|
|
||||||
####### Status of Builds
|
####### Status of Builds
|
||||||
|
@ -84,7 +85,7 @@ let
|
||||||
irc = words.IRC("irc.freenode.net", "krebsbuild",
|
irc = words.IRC("irc.freenode.net", "krebsbuild",
|
||||||
channels=["krebs"],
|
channels=["krebs"],
|
||||||
notify_events={
|
notify_events={
|
||||||
'sucess': 1,
|
'success': 1,
|
||||||
'failure': 1,
|
'failure': 1,
|
||||||
'exception': 1,
|
'exception': 1,
|
||||||
'successToFailure': 1,
|
'successToFailure': 1,
|
||||||
|
@ -145,26 +146,34 @@ let
|
||||||
description = "Buildbot Master";
|
description = "Buildbot Master";
|
||||||
after = [ "network.target" ];
|
after = [ "network.target" ];
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
serviceConfig = {
|
serviceConfig = let
|
||||||
|
workdir="${lib.shell.escape cfg.workDir}";
|
||||||
|
in {
|
||||||
|
pidfile="${workdir}/twistd.pid";
|
||||||
PermissionsStartOnly = true;
|
PermissionsStartOnly = true;
|
||||||
|
Type = "forking";
|
||||||
|
PIDFile = "${workdir}/twistd.pid";
|
||||||
# TODO: maybe also prepare buildbot.tac?
|
# TODO: maybe also prepare buildbot.tac?
|
||||||
ExecStartPre = pkgs.writeScript "buildbot-master-init" ''
|
ExecStartPre = pkgs.writeScript "buildbot-master-init" ''
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -efux
|
set -efux
|
||||||
workdir=${lib.shell.escape cfg.workDir}
|
if [ ! -e ${workdir} ];then
|
||||||
if [ ! -e $workdir ];then
|
mkdir -p ${workdir}
|
||||||
mkdir -p $workdir
|
${buildbot}/bin/buildbot create-master -r -l 10 -f ${workdir}
|
||||||
${buildbot}/bin/buildbot create-master -r -l 10 -f $workdir
|
|
||||||
chown buildbotMaster:buildbotMaster $workdir
|
|
||||||
fi
|
fi
|
||||||
# always override the master.cfg
|
# always override the master.cfg
|
||||||
cp ${toString buildbot-master-config} "$workdir/master.cfg"
|
cp ${buildbot-master-config} ${workdir}/master.cfg
|
||||||
# sanity
|
# sanity
|
||||||
${buildbot}/bin/buildbot checkconfig $workdir
|
${buildbot}/bin/buildbot checkconfig ${workdir}
|
||||||
# upgrade
|
|
||||||
${buildbot}/bin/buildbot upgrade-master $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";
|
PrivateTmp = "true";
|
||||||
User = "buildbotMaster";
|
User = "buildbotMaster";
|
||||||
Restart = "always";
|
Restart = "always";
|
||||||
|
|
Loading…
Reference in a new issue