# HG changeset patch # User Jeff Hammel # Date 1295893267 28800 # Node ID a67fb62c04a67964fb38a646704c810668b8641b # Parent 1abbe826d0f36c54b1c1804a5853957acd4854c5 start adding sources to the master.mfg diff -r 1abbe826d0f3 -r a67fb62c04a6 autobot/projects/autobot/__init__.py --- a/autobot/projects/autobot/__init__.py Sun Jan 23 17:04:36 2011 -0800 +++ b/autobot/projects/autobot/__init__.py Mon Jan 24 10:21:07 2011 -0800 @@ -6,11 +6,13 @@ """ factory to test autobot """ + + sources = {'hg': ['http://k0s.org/mozilla/hg/autobot']) + def __init__(self, slaveport=7357, htmlport=7358): # setup the environment - PythonSourceFactory.__init__(self, name='autobot', - hg_sources=['http://k0s.org/mozilla/hg/autobot']) + PythonSourceFactory.__init__(self, name='autobot') # find the necessary scripts self.findScript('create-autobot') diff -r 1abbe826d0f3 -r a67fb62c04a6 autobot/template/master/master.cfg --- a/autobot/template/master/master.cfg Sun Jan 23 17:04:36 2011 -0800 +++ b/autobot/template/master/master.cfg Mon Jan 24 10:21:07 2011 -0800 @@ -13,11 +13,11 @@ for slave in config.slaves] c['slavePortnum'] = config.master['slaveport'] -####### CHANGESOURCES -from buildbot.changes.pb import PBChangeSource -c['change_source'] = [PBChangeSource()] +####### BUILDERS -####### BUILDERS +sources = {'git': set(), + 'hg': set()} + # define builder factories from autobot.projects import factories as factory_dict @@ -35,9 +35,33 @@ 'factory': f, } builders.append(b) + + # get change sources + # XXX this should be moved to real code, not pseudo-config + if not hasattr(f, 'sources'): + continue + for source_type in sources: + _sources = getattr(_sources).get(source_type, []) + if isinstance(_sources, basestring): + _sources = _sources.split() + for source in _sources: + if instance(source, basestring): + branch = None + if '#' in source: + source, branch = source.rsplit('#', 1) + else: # tuple + source, branch = source + sources[source_type].add((source, branch)) c['builders'] = builders +####### CHANGESOURCES +from buildbot.changes.pb import PBChangeSource +c['change_source'] = [PBChangeSource()] + +from buildbot.changes.gitpoller import GitPoller +from autobot.changes.poller import HgPoller + ####### SCHEDULERS from buildbot.scheduler import Scheduler buildernames = [i['name'] for i in builders]