From c6b9ff9424232fe20818ec586ee20c8b67bdec69 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 20 Jun 2017 01:08:42 +0200 Subject: l 2 buildbot: introduce build_host function --- lass/2configs/buildbot-standalone.nix | 47 +++++++++++------------------------ 1 file changed, 15 insertions(+), 32 deletions(-) (limited to 'lass/2configs') diff --git a/lass/2configs/buildbot-standalone.nix b/lass/2configs/buildbot-standalone.nix index 11eb9052e..6b8901904 100644 --- a/lass/2configs/buildbot-standalone.nix +++ b/lass/2configs/buildbot-standalone.nix @@ -103,45 +103,28 @@ in { build-hosts = '' f = util.BuildFactory() f.addStep(grab_repo) - for i in [ "test-minimal-deploy", "test-all-krebs-modules", "wolf", "test-centos7" ]: - addShell(f,name="build-{}".format(i),env=env_shared, - command=nixshell + \ - ["mkdir -p $HOME/$LOGNAME && touch $HOME/$LOGNAME/.populate; \ - make NIX_PATH=$HOME/$LOGNAME test method=build \ - target=buildbotworker@${config.krebs.build.host.name}$HOME/$LOGNAME \ - system={}".format(i) - ] + + def build_host(env, host): + addShell(f,name="build-{}".format(i),env=env, + command=nixshell + ["mkdir -p $HOME/$LOGNAME && touch $HOME/$LOGNAME/.populate; \ + echo $HOME; echo $LOGNAME; \ + test -e $HOME/$LOGNAME/nixpkgs || cp -r /var/src/nixpkgs $HOME/$LOGNAME/; \ + make NIX_PATH=$HOME/$LOGNAME:secrets=/var/src/stockholm/null test method=build \ + target=buildbotworker@${config.krebs.build.host.name}$HOME/$LOGNAME \ + system={}".format(host)] ) for i in [ "mors", "uriel", "shodan", "icarus", "cloudkrebs", "echelon", "dishfire", "prism" ]: - addShell(f,name="build-{}".format(i),env=env_lass, - command=nixshell + \ - ["mkdir -p $HOME/$LOGNAME && touch $HOME/$LOGNAME/.populate; \ - make NIX_PATH=$HOME/$LOGNAME test method=build \ - target=buildbotworker@${config.krebs.build.host.name}$HOME/$LOGNAME \ - system={}".format(i) - ] - ) + build_host(env_lass, i) for i in [ "x", "wry", "vbob", "wbob", "shoney" ]: - addShell(f,name="build-{}".format(i),env=env_makefu, - command=nixshell + \ - ["mkdir -p $HOME/$LOGNAME && touch $HOME/$LOGNAME/.populate; \ - make NIX_PATH=$HOME/$LOGNAME test method=build \ - target=buildbotworker@${config.krebs.build.host.name}$HOME/$LOGNAME \ - system={}".format(i) - ] - ) + build_host(env_makefu, i) for i in [ "hiawatha", "onondaga" ]: - addShell(f,name="build-{}".format(i),env=env_nin, - command=nixshell + \ - ["mkdir -p $HOME/$LOGNAME && touch $HOME/$LOGNAME/.populate; \ - make NIX_PATH=$HOME/$LOGNAME test method=build \ - target=buildbotworker@${config.krebs.build.host.name}$HOME/$LOGNAME \ - system={}".format(i) - ] - ) + build_host(env_nin, i) + + for i in [ "test-minimal-deploy", "test-all-krebs-modules", "wolf", "test-centos7" ]: + build_host(env_shared, i) bu.append( util.BuilderConfig( -- cgit v1.2.3