# -*- python -*- # vim: set syntax=python:et:ts=4:sw=4: # This is a sample buildmaster config file. It must be installed as # 'master.cfg' in your buildmaster's base directory. # This is the dictionary that the buildmaster pays attention to. We also use # a shorter alias to save typing. c = BuildmasterConfig = {} ####### BUILDSLAVES # The 'slaves' list defines the set of recognized buildslaves. Each element is # a BuildSlave object, specifying a username and password. The same username and # password must be configured on the slave. from buildbot.buildslave import BuildSlave c['slaves'] = [ BuildSlave("opensrf-slave", "XXX", max_builds=1), BuildSlave("eg-slave", "XXX", max_builds=1), BuildSlave("eg-u804", "XXX", max_builds=1), BuildSlave("eg-u1004", "XXX", max_builds=1) ] # 'slavePortnum' defines the TCP port to listen on for connections from slaves. # This must match the value configured into the buildslaves (with their # --master option) c['slavePortnum'] = XXX # Branches and distros to build osrf_branches = ('trunk', 'rel_1_6', 'rel_2_0') osrf_distros = ({'ubuntu-10.04-x86_64': 'opensrf-slave'}) eg_branches = ('trunk', 'rel_1_6_1', 'rel_2_0', 'rel_2_1') eg_distros = ( {'debian-6.00-x86_64': 'eg-slave'}, # UPEI {'ubuntu-8.04-x86': 'eg-u804'}, # GPLS {'ubuntu-10.04-x86': 'eg-u1004'} # GPLS ) ####### CHANGESOURCES # the 'change_source' setting tells the buildmaster how it should find out # about source code changes. Here we point to OpenSRF: def split_file_branches_trunk(path): pieces = path.split('/') if pieces[0] == 'trunk': return ('trunk', '/'.join(pieces[1:])) elif pieces[0] == 'branches': return ('/'.join(pieces[0:2]), '/'.join(pieces[2:])) else: return None from buildbot.changes import svnpoller c['change_source'] = ( svnpoller.SVNPoller( project='OpenSRF', svnurl='svn://svn.open-ils.org/OpenSRF', split_file=svnpoller.split_file_branches, pollinterval=600), svnpoller.SVNPoller( project='Evergreen', svnurl='svn://svn.open-ils.org/ILS', split_file=svnpoller.split_file_branches, pollinterval=600) ) ####### FILTERS from buildbot.schedulers.filter import ChangeFilter trunk_filter = ChangeFilter(project='OpenSRF', branch=None) rel_1_6_filter = ChangeFilter(project='OpenSRF', branch="branches/rel_1_6") rel_2_0_filter = ChangeFilter(project='OpenSRF', branch="branches/rel_2_0") eg_rel_1_6_1_filter = ChangeFilter(project='Evergreen', branch="branches/rel_1_6_1") eg_rel_2_0_filter = ChangeFilter(project='Evergreen', branch="branches/rel_2_0") eg_rel_2_1_filter = ChangeFilter(project='Evergreen', branch="branches/rel_2_1") eg_trunk_filter = ChangeFilter(project='Evergreen', branch=None) ####### SCHEDULERS # Configure the Schedulers, which decide how to react to incoming changes. In this # case, just kick off a 'runtests' build from buildbot.scheduler import Scheduler c['schedulers'] = [] c['schedulers'].append(Scheduler(name="osrf-trunk-full", treeStableTimer=300, change_filter=trunk_filter, builderNames=["osrf-trunk-ubuntu-10.04-x86_64"])) c['schedulers'].append(Scheduler(name="osrf-rel_1_6", treeStableTimer=300, change_filter=rel_1_6_filter, builderNames=["osrf-rel_1_6-ubuntu-10.04-x86_64"])) c['schedulers'].append(Scheduler(name="osrf-rel_2_0", treeStableTimer=300, change_filter=rel_2_0_filter, builderNames=["osrf-rel_2_0-ubuntu-10.04-x86_64"])) c['schedulers'].append(Scheduler(name="evergreen-rel_1_6_1", treeStableTimer=300, change_filter=eg_rel_1_6_1_filter, builderNames=[ "evergreen-rel_1_6_1-debian-6.00-x86_64", "evergreen-rel_1_6_1-ubuntu-8.04-x86", "evergreen-rel_1_6_1-ubuntu-10.04-x86" ])) c['schedulers'].append(Scheduler(name="evergreen-rel_2_0", treeStableTimer=300, change_filter=eg_rel_2_0_filter, builderNames=[ "evergreen-rel_2_0-debian-6.00-x86_64", "evergreen-rel_2_0-ubuntu-8.04-x86", "evergreen-rel_2_0-ubuntu-10.04-x86" ])) c['schedulers'].append(Scheduler(name="evergreen-rel_2_1", treeStableTimer=300, change_filter=eg_rel_2_1_filter, builderNames=[ "evergreen-rel_2_1-debian-6.00-x86_64", "evergreen-rel_2_1-ubuntu-8.04-x86", "evergreen-rel_2_1-ubuntu-10.04-x86" ])) c['schedulers'].append(Scheduler(name="evergreen-trunk", treeStableTimer=300, change_filter=eg_trunk_filter, builderNames=[ "evergreen-trunk-debian-6.00-x86_64", "evergreen-trunk-ubuntu-8.04-x86", "evergreen-trunk-ubuntu-10.04-x86" ])) ####### BUILDERS # The 'builders' list defines the Builders, which tell Buildbot how to perform a build: # what steps, and which slaves can execute them. Note that any particular build will # only take place on one slave. from buildbot.process.factory import BuildFactory from buildbot.steps import source from buildbot.steps import shell from buildbot.steps import python from buildbot.steps import python_twisted osrf_factory = BuildFactory() # check out the source osrf_factory.addStep(source.SVN( baseURL='svn://svn.open-ils.org/OpenSRF/', defaultBranch='trunk', mode='copy')) # bootstrap the code osrf_factory.addStep(shell.ShellCommand(command=["./autogen.sh"])) # configure (default args for now) osrf_factory.addStep(shell.Configure()) # compile the code osrf_factory.addStep(shell.Compile(command=["make"])) # run the Perl unit tests osrf_factory.addStep(shell.PerlModuleTest(workdir="build/src/perl")) # run the Python unit tests (available after rel_1_6) def has_python_unit_test(step): return step.build.getProperty('branch') != 'branches/rel_1_6' osrf_factory.addStep(python_twisted.Trial( doStepIf=has_python_unit_test, testpath="build", tests="src/python/tests/json_test.py")) # report on the Python code osrf_factory.addStep(python.PyLint( env={"PYTHONPATH": ["src/python"]}, flunkOnFailure=False, command=["pylint", "--output-format=parseable", "src/python/opensrf.py", "src/python/osrf/app.py", "src/python/osrf/cache.py", "src/python/osrf/conf.py", "src/python/osrf/const.py", "src/python/osrf/ex.py", "src/python/osrf/gateway.py", "src/python/osrf/http_translator.py", "src/python/osrf/json.py", "src/python/osrf/log.py", "src/python/osrf/net_obj.py", "src/python/osrf/net.py", "src/python/osrf/server.py", "src/python/osrf/ses.py", "src/python/osrf/set.py", "src/python/osrf/stack.py", "src/python/osrf/system.py", "src/python/osrf/xml_obj.py", "src/python/osrf/apps/example.py"])) eg_factory = BuildFactory() # check out the source eg_factory.addStep(source.SVN( baseURL='svn://svn.open-ils.org/ILS/', defaultBranch='trunk', mode='copy')) # bootstrap the code eg_factory.addStep(shell.ShellCommand(command=["./autogen.sh"])) # configure (default args for now) eg_factory.addStep(shell.Configure()) # compile the code eg_factory.addStep(shell.Compile(command=["make"])) perldir = 'build/Open-ILS/src/perlmods' class PerlModuleTestMFHDMadness(shell.PerlModuleTest): 'Override PerlModuleTest with nonstandard library location for testlib.pm' command = ['prove', '--lib', 'lib', '-I', 'lib/OpenILS/Utils/MFHD/test', '-r', 't'] total = 0 def has_perl_unit_tests(step): 'Only run Perl tests if there are tests' if (step.build.getProperty('branch') == 'branches/rel_1_6_1'): return False elif (step.build.getProperty('branch') == 'branches/rel_2_0'): return False return True # run the Perl unit tests eg_factory.addStep(PerlModuleTestMFHDMadness( doStepIf=has_perl_unit_tests, workdir=perldir) ) # report on the Python code eg_factory.addStep(python.PyLint( env={"PYTHONPATH": ["Open-ILS/src/python"]}, flunkOnFailure=False, command=["pylint", "--output-format=parseable", "Open-ILS/src/python/setup.py", "Open-ILS/src/python/oils/const.py", "Open-ILS/src/python/oils/event.py", "Open-ILS/src/python/oils/__init__.py", "Open-ILS/src/python/oils/org.py", "Open-ILS/src/python/oils/srfsh.py", "Open-ILS/src/python/oils/system.py", "Open-ILS/src/python/oils/utils/csedit.py", "Open-ILS/src/python/oils/utils/idl.py", "Open-ILS/src/python/oils/utils/__init__.py", "Open-ILS/src/python/oils/utils/utils.py" ] )) from buildbot.config import BuilderConfig c['builders'] = [] for branch in osrf_branches: for distro, slave in osrf_distros: build = "osrf-%s-%s" % (branch, distro) c['builders'].append(name=build, slavenames=slave, factory=osrf_factory) for branch in eg_branches: for distro, slave in eg_distros: build = "evergreen-%s-%s" % (branch, distro) c['builders'].append(name=build, slavenames=slave, factory=eg_factory) ####### STATUS TARGETS # 'status' is a list of Status Targets. The results of each build will be # pushed to these targets. buildbot/status/*.py has a variety to choose from, # including web pages, email senders, and IRC bots. c['status'] = [] from buildbot.status import html from buildbot.status.web import auth, authz users = [('XXX', 'XXX'), ('XXX', 'XXX')] authz_cfg = authz.Authz( auth=auth.BasicAuth(users), # change any of these to True to enable; see the manual for more # options gracefulShutdown = False, forceBuild = 'auth', # use this to test your slave once it is set up forceAllBuilds = False, pingBuilder = False, stopBuild = False, stopAllBuilds = False, cancelPendingBuild = False, ) c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg)) # Send mail when a build is broken from buildbot.status.mail import MailNotifier mn = MailNotifier( fromaddr="buildbot@testing.esilibrary.com", sendToInterestedUsers=False, mode='problem', extraRecipients=["dan@coffeecode.net","open-ils-dev@list.georgialibraries.org"]) # Uncomment to actually send mail # c['status'].append(mn) ####### PROJECT IDENTITY # the 'projectName' string will be used to describe the project that this # buildbot is working on. For example, it is used as the title of the # waterfall HTML page. The 'projectURL' string will be used to provide a link # from buildbot HTML pages to your project's home page. c['projectName'] = "Evergreen and OpenSRF" c['projectURL'] = "http://evergreen-ils.org/" # the 'buildbotURL' string should point to the location where the buildbot's # internal web server (usually the html.WebStatus page) is visible. This # typically uses the port number set in the Waterfall 'status' entry, but # with an externally-visible host name which the buildbot cannot figure out # without some help. c['buildbotURL'] = "http://testing.evergreen-ils.org/buildbot/" ####### DB URL # This specifies what database buildbot uses to store change and scheduler # state. You can leave this at its default for all but the largest # installations. c['db_url'] = "sqlite:///state.sqlite"