Mercurial > hg > autobot
view autobot/projects/autobot/__init__.py @ 189:cb9ad0b04140
preliminary passing of platform information from slaves; not yet tested
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Wed, 02 Feb 2011 09:11:28 -0800 |
parents | a0866ad63d93 |
children | 44ca3474d03d |
line wrap: on
line source
from autobot.process.factory import PythonSourceFactory from buildbot.steps.shell import ShellCommand from buildbot.steps.shell import WithProperties class TestAutobotFactory(PythonSourceFactory): """ factory to test autobot """ sources = {'hg': ['http://k0s.org/mozilla/hg/autobot']} def __init__(self, platform=None, slaveport=7357, htmlport=7358): # setup the environment PythonSourceFactory.__init__(self, platform=platform, name='autobot') # find the necessary scripts self.findScript('create-autobot') self.findScript('buildbot') self.findScript('buildslave') # make sure the template creator actually does something self.addStep(ShellCommand(command=[WithProperties('%(create-autobot)s'), '--list-factories'], description='create-autobot --list-factories')) # make a master, slave pair self.addStep(ShellCommand(command=[WithProperties('%(create-autobot)s'), '-f', '-', # all factories, '--slaveport', str(slaveport), '--htmlport', str(htmlport), 'bot'], description="make an autobot", workdir=WithProperties('%(virtualenv)s'), haltOnFailure=True)) # make sure they start self.addStep(ShellCommand(command=[WithProperties('%(buildbot)s'), 'start', 'master'], workdir=WithProperties('%(virtualenv)s/bot'), description='start build master')) self.addStep(ShellCommand(command=[WithProperties('%(buildslave)s'), 'start', 'slave'], workdir=WithProperties('%(virtualenv)s/bot'), description='start build slave')) # try to access the waterfall self.addStep(ShellCommand(command=['curl', 'http://localhost:%s/' % htmlport])) # could try to actually build, but we won't here # stop them! self.addStep(ShellCommand(command=[WithProperties('%(buildbot)s'), 'stop', 'master'], workdir=WithProperties('%(virtualenv)s/bot'), description='stop build master')) self.addStep(ShellCommand(command=[WithProperties('%(buildslave)s'), 'stop', 'slave'], workdir=WithProperties('%(virtualenv)s/bot'), description='stop build slave'))