# HG changeset patch # User Jeff Hammel # Date 1293045345 28800 # Node ID 8e14b6322cc723188a13814a748d2a204822e3a8 initial stub for ateam buildbot diff -r 000000000000 -r 8e14b6322cc7 INSTALL.sh --- /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 diff -r 000000000000 -r 8e14b6322cc7 QUESTIONS.txt --- /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? diff -r 000000000000 -r 8e14b6322cc7 autobot/__init__.py --- /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 @@ +# diff -r 000000000000 -r 8e14b6322cc7 autobot/central/__init__.py --- /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 +""" diff -r 000000000000 -r 8e14b6322cc7 autobot/process/__init__.py diff -r 000000000000 -r 8e14b6322cc7 autobot/process/factory.py --- /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')) diff -r 000000000000 -r 8e14b6322cc7 autobot/projects/__init__.py diff -r 000000000000 -r 8e14b6322cc7 autobot/projects/logparser/__init__.py --- /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/']) + diff -r 000000000000 -r 8e14b6322cc7 autobot/steps/__init__.py --- /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 diff -r 000000000000 -r 8e14b6322cc7 autobot/steps/virtualenv.py --- /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) diff -r 000000000000 -r 8e14b6322cc7 autobot/template/README.txt --- /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 diff -r 000000000000 -r 8e14b6322cc7 autobot/template/master/master.cfg --- /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}}/" diff -r 000000000000 -r 8e14b6322cc7 projects.txt --- /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 + diff -r 000000000000 -r 8e14b6322cc7 setup.py --- /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: -*- + """, + )