# HG changeset patch # User Jeff Hammel # Date 1294769733 28800 # Node ID cbcb96142ed6c4727de910a1f2f30e31193c695d # Parent 288397616e5f11f8f9fd304b9676e2a80a3ea73c stubs towards specifying multiple factories diff -r 288397616e5f -r cbcb96142ed6 autobot/template.py --- a/autobot/template.py Tue Jan 11 09:51:46 2011 -0800 +++ b/autobot/template.py Tue Jan 11 10:15:33 2011 -0800 @@ -41,15 +41,15 @@ Variable('htmlport', 'port for waterfall display', default=8010, cast=int)] def pre(self, variables): - factory = variables.get('factory') + factory = variables.get('factories') if factory: - assert factory in factories, 'Factory must be one of: ' % ', '.join(factories.keys()) + assert(set(factory).issubset(factories.keys())), 'Factory must be one of: ' % ', '.join(factories.keys()) elif self.interactive: print print_descriptions() sys.stdout.write('Enter factory: ') factory = raw_input() assert factory in factories, 'Factory must be one of: ' % ', '.join(factories.keys()) - variables['factory'] = factory + variables['factories'] = [factory] else: raise AssertionError("No factory provided") @@ -64,6 +64,7 @@ """ self.create(self.output, variables) + class AutobotSlaveTemplate(MakeItSoTemplate): name = 'autobot-slave' description = 'template for the autotools buildbot slave' @@ -105,7 +106,8 @@ """ def parser(self): parser = MakeItSoCLI.parser(self) - parser.add_option('-f', '--factory', dest='factory', + parser.add_option('-f', '--factory', dest='factories', + default=[], action='append', help="factory to use") parser.add_option('--list-factories', dest='_list_factories', default=False, action='store_true', diff -r 288397616e5f -r cbcb96142ed6 autobot/template/master/master.cfg --- a/autobot/template/master/master.cfg Tue Jan 11 09:51:46 2011 -0800 +++ b/autobot/template/master/master.cfg Tue Jan 11 10:15:33 2011 -0800 @@ -20,17 +20,22 @@ ####### BUILDERS -# define builder factory -from autobot.projects import factories -f1 = factories['{{factory}}']() +# define builder factories +from autobot.projects import factories as factory_dict +builders = [] -# define builder -b1 = {'name': "buildbot-full", - 'slavename': "{{slave}}", - 'builddir': "full", - 'factory': f1, - } -c['builders'] = [b1] +for factory in {{factories}}: + f = factory_dict['{{factory}}']() + + # define builder + b = {'name': "buildbot-" + factory, + 'slavename': "{{slave}}", + 'builddir': "full", + 'factory': f, + } + builders.append(b) + +c['builders'] = builders ####### STATUS TARGETS c['status'] = []