Mercurial > hg > autobot
changeset 0:8e14b6322cc7
initial stub for ateam buildbot
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Wed, 22 Dec 2010 11:15:45 -0800 |
parents | |
children | 3bd7f767d74a |
files | INSTALL.sh QUESTIONS.txt autobot/__init__.py autobot/central/__init__.py autobot/process/__init__.py autobot/process/factory.py autobot/projects/__init__.py autobot/projects/logparser/__init__.py autobot/steps/__init__.py autobot/steps/virtualenv.py autobot/template/README.txt autobot/template/master/master.cfg projects.txt setup.py |
diffstat | 12 files changed, 141 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/INSTALL.sh Wed Dec 22 11:15:45 2010 -0800 @@ -0,0 +1,5 @@ +virtualenv.py autobot +cd autobot +. bin/activate # linux only +mkdir src +cd src
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/QUESTIONS.txt Wed Dec 22 11:15:45 2010 -0800 @@ -0,0 +1,4 @@ + - How do we want to deal with e.g. mozilla-central? Do we want to... + * grab from ftp? + * build from scratch each time? + * hg update and build that way?
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/autobot/__init__.py Wed Dec 22 11:15:45 2010 -0800 @@ -0,0 +1,1 @@ +#
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/autobot/central/__init__.py Wed Dec 22 11:15:45 2010 -0800 @@ -0,0 +1,3 @@ +""" +buildbot stuff for mozilla central +"""
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/autobot/process/factory.py Wed Dec 22 11:15:45 2010 -0800 @@ -0,0 +1,26 @@ +from autobot.steps import CreateVirtualenv +from buildbot.process.factory import BuildFactory + +""" +generic factories +""" + +class VirtualenvFactory(BuildFactory): + """ + create a virtualenv + """ + + def __init__(self, name='env', hg_sources=None): + """ + - name : of the virtualenv + - hg_sources : sources of python packages with setuptools setup.pys + """ + BuildFactory.__init__(self) + self.addStep(CreateVirtualenv(name)) + self.addStep(ShellCommand(command=['mkdir', 'src'], + directory=name)) + # TODO: set properities: + # - python location + for hg_source in hg_sources: + self.addStep(ShellCommand(command=['hg', 'clone', hg_source], + directory=name + '/src'))
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/autobot/projects/logparser/__init__.py Wed Dec 22 11:15:45 2010 -0800 @@ -0,0 +1,11 @@ +from autobot.process.factory import VirtualenvFactory + +class TestLogParserFactory(VirtualenvFactory): + """ + factory to test the Mozilla log parser: + http://hg.mozilla.org/automation/logparser/ + """ + def __init__(self): + VirtualenvFactory.__init__(self, name='logparser', + hg_sources=['http://hg.mozilla.org/automation/logparser/']) +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/autobot/steps/__init__.py Wed Dec 22 11:15:45 2010 -0800 @@ -0,0 +1,2 @@ +# convenience imports +from virtualenv import CreateVirtualenv
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/autobot/steps/virtualenv.py Wed Dec 22 11:15:45 2010 -0800 @@ -0,0 +1,10 @@ +from buildbot.process.properties import WithProperties +from buildbot.steps.shell import ShellCommand + +class CreateVirtualenv(ShellCommand): + """create a virtualenv""" + # XXX needs to have virtualenv installed (on the slave) + + def __init__(self, directory): + command = ['virtualenv', WithProperties(directory)] + ShellCommand.__init__(self, command=command)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/autobot/template/README.txt Wed Dec 22 11:15:45 2010 -0800 @@ -0,0 +1,1 @@ +Templates to create a buildmaster and buildslave
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/autobot/template/master/master.cfg Wed Dec 22 11:15:45 2010 -0800 @@ -0,0 +1,42 @@ +# -*- python -*- +# ex: set syntax=python: +c = BuildmasterConfig = {} + +####### BUILDSLAVES +from buildbot.buildslave import BuildSlave +c['slaves'] = [BuildSlave("{{botname}}", "{{passwd}}")] +c['slavePortnum'] = {{slaveport}} + +####### CHANGESOURCES +from buildbot.changes.pb import PBChangeSource +c['change_source'] = PBChangeSource() + +####### SCHEDULERS +from buildbot.scheduler import Scheduler +c['schedulers'] = [] +c['schedulers'].append(Scheduler(name="all", branch='${branch}', + treeStableTimer=1, + builderNames=["buildbot-full"])) + +####### BUILDERS + +# define builder factory +f1 = {{factory}} + +# define builder +b1 = {'name': "buildbot-full", + 'slavename': "{{botname}}", + 'builddir': "full", + 'factory': f1, + } +c['builders'] = [b1] + +####### STATUS TARGETS +c['status'] = [] +from buildbot.status import html +c['status'].append(html.WebStatus(http_port={{htmlport}})) + +####### PROJECT IDENTITY +c['projectName'] = "Buildbot" +c['projectURL'] = "http://buildbot.sourceforge.net/" +c['buildbotURL'] = "http://localhost:{{htmlport}}/"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/projects.txt Wed Dec 22 11:15:45 2010 -0800 @@ -0,0 +1,7 @@ +* mozmill +* jetpack thing +* devicemanager +* profilemanager +* logparser +* firebug +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/setup.py Wed Dec 22 11:15:45 2010 -0800 @@ -0,0 +1,29 @@ +from setuptools import setup, find_packages +import sys, os + +version = '0.0' + +setup(name='autobot', + version=version, + description="buildbot incarnation for Mozilla AutoTools team", + long_description="""\ +""", + classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers + keywords='buildbot automation', + author='Jeff Hammel', + author_email='jhammel@mozilla.com', + url='https://wiki.mozilla.org/Auto-tools', + license='MPL', + packages=find_packages(exclude=['ez_setup', 'examples', 'tests']), + include_package_data=True, + zip_safe=False, + install_requires=[ + # -*- Extra requirements: -*- + 'buildbot', + 'buildbot-slave', + 'virtualenv' + ], + entry_points=""" + # -*- Entry points: -*- + """, + )