commit 7b44f32af866524dfe51d3af88813204120bac28
parent 816c0604951b5a533dd3dbfc65a0e335f7a2ffdc
Author: Marcello Stanisci <marcello.stanisci@inria.fr>
Date: Mon, 20 Jun 2016 23:07:38 +0200
function that picks the non active blue-green party in order to launch it as slave
Diffstat:
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/buildbot/master.cfg b/buildbot/master.cfg
@@ -72,6 +72,20 @@ from buildbot.steps.shell import Compile
from buildbot.steps.shell import Test
import os
+def pickSlave(builder, slaves):
+ map = {'green': 'testGreenSlave',
+ 'blue': 'testBlueSlave'}
+ toPick = "blue"
+ activePath = os.readlink("/home/test/sockets")
+ if "blue" in activePath:
+ toPick = "green"
+ for s in slaves:
+ if map[toPick] == s.slavename:
+ return s
+ print("No suitable slave found")
+ return None
+
+
globalSwitcher = BuildFactory()
globalSwitcher.addStep(Git(repourl='git://git.taler.net/deployment.git',
mode='full',
@@ -112,7 +126,8 @@ c['builders'] = []
c['builders'].append(
BuilderConfig(name="global-switcher",
slavenames=["testGreenSlave", "testBlueSlave"],
- factory=globalSwitcher))
+ factory=globalSwitcher,
+ nextSlave=pickSlave))
c['builders'].append(
BuilderConfig(name="lcov-build",
slavenames=["lcovSlave"],