From 87694e24df0ebbaaa08d4f632fea72f48bc430f5 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 16 Dec 2015 17:11:42 +0100 Subject: m 3 buildbot.master: add deps, refactor --- makefu/3modules/buildbot/master.nix | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'makefu/3modules') diff --git a/makefu/3modules/buildbot/master.nix b/makefu/3modules/buildbot/master.nix index 5d340f89..0073e5ae 100644 --- a/makefu/3modules/buildbot/master.nix +++ b/makefu/3modules/buildbot/master.nix @@ -43,14 +43,26 @@ let name="force", builderNames=["runtests"])) ###### The actual build - factory = util.BuildFactory() - factory.addStep(steps.Git(repourl=stockholm_repo, mode='incremental')) + f = util.BuildFactory() + f.addStep(steps.Git(repourl=stockholm_repo, mode='incremental')) + # 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(**kwargs): + f.addStep(steps.ShellCommand(**kwargs)) + + # TODO: combined strings somewhat defeat the reason why an array was used in first place + addShell(name=env={"LOGNAME": "shared", + "get" : "krebs.deploy", + "filter" : "json" + }, + command=nixshell + ["make -s eval system=test-centos7"]) + addShell(env={"LOGNAME": "shared", + "get" : "krebs.deploy", + "filter" : "json" + }, + command=nixshell + ["make -s eval system=wolf"]) # TODO: different Builders? c['builders'] = [] @@ -58,7 +70,7 @@ let util.BuilderConfig(name="runtests", # TODO: only some slaves being used in builder? slavenames=slavenames, - factory=factory)) + factory=f)) ####### Status of Builds c['status'] = [] @@ -183,8 +195,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"; -- cgit v1.2.3