summaryrefslogtreecommitdiffstats
path: root/makefu/3modules/buildbot/master.nix
diff options
context:
space:
mode:
authorlassulus <lass@aidsballs.de>2015-12-20 19:00:20 +0100
committerlassulus <lass@aidsballs.de>2015-12-20 19:00:20 +0100
commit85f3aa5b86ab9fd4afb7e5adafc0e329ab618102 (patch)
treeb5a8f94d5af87eb24c0df3a85577ab9fe4542419 /makefu/3modules/buildbot/master.nix
parent07f4510ad0bff0f9d72e5dcee279a30a0d5f8da3 (diff)
parent5821d8438578db623a3e248c52fefa424fad0b51 (diff)
Merge remote-tracking branch 'gum/master'
Diffstat (limited to 'makefu/3modules/buildbot/master.nix')
-rw-r--r--makefu/3modules/buildbot/master.nix89
1 files changed, 63 insertions, 26 deletions
diff --git a/makefu/3modules/buildbot/master.nix b/makefu/3modules/buildbot/master.nix
index 5d340f899..58e2f8175 100644
--- a/makefu/3modules/buildbot/master.nix
+++ b/makefu/3modules/buildbot/master.nix
@@ -6,6 +6,7 @@ let
buildbot-master-config = pkgs.writeText "buildbot-master.cfg" ''
# -*- python -*-
from buildbot.plugins import *
+ import re
c = BuildmasterConfig = {}
@@ -25,40 +26,72 @@ let
stockholm_repo,
workdir='stockholm-poller', branch='master',
project='stockholm',
- pollinterval=300))
+ pollinterval=120))
####### Build Scheduler
# TODO: configure scheduler
- important_files = util.ChangeFilter(
- project_re="^((krebs|share)/.*|Makefile|default.nix)",
- branch='master')
c['schedulers'] = []
- c['schedulers'].append(schedulers.SingleBranchScheduler(
- name="all-important-files",
- change_filter=important_files,
- # 3 minutes stable tree
- treeStableTimer=3*60,
- builderNames=["runtests"]))
- c['schedulers'].append(schedulers.ForceScheduler(
+
+ # test the master real quick
+ fast = schedulers.SingleBranchScheduler(
+ change_filter=util.ChangeFilter(branch="master"),
+ name="fast-master-test",
+ builderNames=["fast-tests"])
+
+ force = schedulers.ForceScheduler(
name="force",
- builderNames=["runtests"]))
+ builderNames=["full-tests"])
+
+ # files everyone depends on or are part of the share branch
+ def shared_files(change):
+ r =re.compile("^((krebs|share)/.*|Makefile|default.nix)")
+ for file in change.files:
+ if r.match(file):
+ return True
+ return False
+
+ full = schedulers.SingleBranchScheduler(
+ change_filter=util.ChangeFilter(branch="master"),
+ fileIsImportant=shared_files,
+ name="full-master-test",
+ builderNames=["full-tests"])
+ c['schedulers'] = [ fast, force, full ]
###### The actual build
- factory = util.BuildFactory()
- factory.addStep(steps.Git(repourl=stockholm_repo, mode='incremental'))
+ # couple of fast steps:
+ f = util.BuildFactory()
+ ## fetch repo
+ grab_repo = steps.Git(repourl=stockholm_repo, mode='incremental')
+ f.addStep(grab_repo)
+ # the dependencies which are used by the test script
deps = [ "gnumake", "jq" ]
- factory.addStep(steps.ShellCommand(command=["nix-shell", "-p" ] + deps ))
- factory.addStep(steps.ShellCommand(env={"LOGNAME": "shared"},
- command=["make", "get=krebs.deploy",
- "system=test-centos7"]))
+ nixshell = ["nix-shell", "-p" ] + deps + [ "--run" ]
+ def addShell(f,**kwargs):
+ f.addStep(steps.ShellCommand(**kwargs))
+
+ addShell(f,name="centos7-eval",env={"LOGNAME": "shared",
+ "get" : "krebs.deploy",
+ "filter" : "json"
+ },
+ command=nixshell + ["make -s eval system=test-centos7"])
+
+ addShell(f,name="wolf-eval",env={"LOGNAME": "shared",
+ "get" : "krebs.deploy",
+ "filter" : "json"
+ },
+ command=nixshell + ["make -s eval system=wolf"])
- # TODO: different Builders?
c['builders'] = []
c['builders'].append(
- util.BuilderConfig(name="runtests",
- # TODO: only some slaves being used in builder?
+ util.BuilderConfig(name="fast-tests",
slavenames=slavenames,
- factory=factory))
+ factory=f))
+
+ # TODO slow build
+ c['builders'].append(
+ util.BuilderConfig(name="full-tests",
+ slavenames=slavenames,
+ factory=f))
####### Status of Builds
c['status'] = []
@@ -86,8 +119,8 @@ let
# TODO: multiple channels
channels=["${cfg.irc.channel}"],
notify_events={
- 'success': 1,
- 'failure': 1,
+ #'success': 1,
+ #'failure': 1,
'exception': 1,
'successToFailure': 1,
'failureToSuccess': 1,
@@ -99,7 +132,9 @@ let
c['title'] = "Stockholm"
c['titleURL'] = "http://krebsco.de"
- c['buildbotURL'] = "http://buildbot.krebsco.de/"
+ #c['buildbotURL'] = "http://buildbot.krebsco.de/"
+ # TODO: configure url
+ c['buildbotURL'] = "http://vbob:8010/"
####### DB URL
c['db'] = {
@@ -112,7 +147,6 @@ let
api = {
enable = mkEnableOption "Buildbot Master";
-
workDir = mkOption {
default = "/var/lib/buildbot/master";
type = types.str;
@@ -157,6 +191,7 @@ let
};
});
};
+
extraConfig = mkOption {
default = "";
type = types.lines;
@@ -183,8 +218,10 @@ let
description = "Buildbot Master";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
+ path = [ pkgs.git ];
serviceConfig = let
workdir="${lib.shell.escape cfg.workDir}";
+ # TODO: check if git is the only dep
in {
PermissionsStartOnly = true;
Type = "forking";