# -*- 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 = {} # WORKDIR must be an absolute path that is not volatile; systems # like Ubuntu wipe /tmp/ on a reboot, for example, which is # disastrous for build history, at least for gitpoller WORKDIR = '/home/buildmaster/' ####### 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-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 = ('master', 'rel_2_1', 'rel_2_0') OSRF_DISTROS = [('ubuntu-10.04-x86_64', 'opensrf-slave')] EG_BRANCHES = ('master', 'rel_2_2', 'rel_2_1') EG_DISTROS = [ ('debian-6.00-x86_64', 'eg-slave'), # UPEI ('ubuntu-10.04-x86', 'eg-u1004') # GPLS ] eg_git = 'git://git.evergreen-ils.org/Evergreen.git' osrf_git = 'git://git.evergreen-ils.org/OpenSRF.git' ####### CHANGESOURCES # the 'change_source' setting tells the buildmaster how it should find out # about source code changes from buildbot.changes import gitpoller c['change_source'] = [] for osrf_branch in OSRF_BRANCHES: c['change_source'].append(gitpoller.GitPoller( project='OpenSRF', repourl=osrf_git, workdir= WORKDIR + 'buildbot_osrf_' + osrf_branch, branch=osrf_branch )) for eg_branch in EG_BRANCHES: c['change_source'].append(gitpoller.GitPoller( project='Evergreen', repourl=eg_git, workdir= WORKDIR + 'buildbot_eg_' + eg_branch, branch=eg_branch )) ####### FILTERS from buildbot.changes.filter import ChangeFilter master_filter = ChangeFilter(project='OpenSRF', branch="master") rel_2_0_filter = ChangeFilter(project='OpenSRF', branch="rel_2_0") rel_2_1_filter = ChangeFilter(project='OpenSRF', branch="rel_2_1") eg_rel_2_1_filter = ChangeFilter(project='Evergreen', branch="rel_2_1") eg_rel_2_2_filter = ChangeFilter(project='Evergreen', branch="rel_2_2") eg_master_filter = ChangeFilter(project='Evergreen', branch="master") ####### SCHEDULERS # Configure the Schedulers, which decide how to react to incoming changes. In this # case, just kick off a 'runtests' build from buildbot.schedulers.basic import SingleBranchScheduler c['schedulers'] = [] c['schedulers'].append(SingleBranchScheduler(name="osrf-master-full", treeStableTimer=300, change_filter=master_filter, builderNames=["osrf-master-ubuntu-10.04-x86_64"])) c['schedulers'].append(SingleBranchScheduler(name="osrf-rel_2_1", treeStableTimer=300, change_filter=rel_2_1_filter, builderNames=["osrf-rel_2_1-ubuntu-10.04-x86_64"])) c['schedulers'].append(SingleBranchScheduler(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(SingleBranchScheduler(name="evergreen-rel_2_2", treeStableTimer=300, change_filter=eg_rel_2_2_filter, builderNames=[ "evergreen-rel_2_2-debian-6.00-x86_64", "evergreen-rel_2_2-ubuntu-10.04-x86" ])) c['schedulers'].append(SingleBranchScheduler(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-10.04-x86" ])) c['schedulers'].append(SingleBranchScheduler(name="evergreen-master", treeStableTimer=300, change_filter=eg_master_filter, builderNames=[ "evergreen-master-debian-6.00-x86_64", "evergreen-master-ubuntu-10.04-x86" ])) #### Build step tests def eg_requires_autogen(step): 'Old versions of Evergreen require autogen.sh to bootstrap' if (step.build.getProperty('branch') == 'rel_2_1'): return True return False def eg_requires_autoreconf(step): 'Modern versions of Evergreen use autoreconf to bootstrap' if eg_requires_autogen(step): return False return True def has_perl_unit_tests(step): 'Only run Perl tests if there are tests' if (step.build.getProperty('branch') == 'rel_2_0'): return False return True def osrf_requires_autogen(step): 'Old versions of OpenSRF require autogen.sh to bootstrap' if (step.build.getProperty('branch') == 'rel_2_0'): return True return False def osrf_requires_autoreconf(step): 'Modern versions of OpenSRF use autoreconf to bootstrap' if osrf_requires_autogen(step): return False return True ####### 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.Git( repourl=osrf_git ) ) # bootstrap the code - old branches require autogen.sh osrf_factory.addStep( shell.ShellCommand(command=["./autogen.sh"], doStepIf=osrf_requires_autogen, name="Bootstrap via autogen" ) ) osrf_factory.addStep( shell.ShellCommand(command=["autoreconf", "-i"], doStepIf=osrf_requires_autoreconf, name="Bootstrap via autoreconf" ) ) # 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")) osrf_factory.addStep(python_twisted.Trial( 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.Git( repourl=eg_git ) ) # bootstrap the code - old branches require autogen.sh eg_factory.addStep( shell.ShellCommand(command=["./autogen.sh"], doStepIf=eg_requires_autogen, name="Bootstrap via autogen" ) ) eg_factory.addStep( shell.ShellCommand(command=["autoreconf", "-f", "-i"], doStepIf=eg_requires_autoreconf, name="Bootstrap via autoreconf" ) ) # 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 # 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(BuilderConfig(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(BuilderConfig(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.evergreen-ils.org", sendToInterestedUsers=True, mode='problem' # , extraRecipients=["dan@coffeecode.net","open-ils-dev@list.georgialibraries.org"] ) # Uncomment to actually send mail c['status'].append(MN) ### IRCBOT from buildbot.status import words IRC = words.IRC("chat.freenode.net", "egbuilder", channels=["#evergreen"], password="XXX", allowForce=False, notify_events={ 'exception': 1, 'successToFailure': 1, 'failureToSuccess': 1, }) c['status'].append(IRC) ####### 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"