#! /usr/bin/python # search for "CONFIG" to find our frequently-changed settings --jm # This is a sample buildmaster config file. It must be installed as # 'master.cfg' in your buildmaster's base directory (although the filename # can be changed with the --basedir option to 'mktap buildbot master'). # It has one job: define a dictionary named BuildmasterConfig. This # dictionary has a variety of keys to control different aspects of the # buildmaster. They are documented in docs/config.xhtml . import os.path from buildbot.status import html from buildbot.process.factory import s # to save typing, we create a dictionary named 'c' and rename it later c = {} c['sources'] = [] from buildbot.changes.mail import SvnCommitsMaildirSource c['sources'].append( SvnCommitsMaildirSource("/home/buildbot/Maildir/commits2", prefix="spamassassin")) # the 'builders' list defines the Builders. Each one is configured with a # dictionary, using the following keys: # name (required): the name used to describe this bilder # slavename (required): which slave to use, must appear in c['bots'] # builddir (required): which subdirectory to run the builder in # factory (required): a BuildFactory to define how the build is run # periodicBuildTime (optional): if set, force a build every N seconds # buildbot/process/factory.py provides several BuildFactory classes you can # start with, which implement build processes for common targets (GNU # autoconf projects, CPAN perl modules, etc). The factory.BuildFactory is the # base class, and is configured with a series of BuildSteps. When the build # is run, the appropriate buildslave is told to execute each Step in turn. # the first BuildStep is typically responsible for obtaining a copy of the # sources. There are source-obtaining Steps in buildbot/process/step.py for # CVS, SVN, and others. c['builders'] = [] c['bots'] = [] from buildbot.steps import source, shell from buildbot.process import factory from buildbot.process.factory import CPAN, s # jm: our builders and bots go here! CONFIG !BOTS! # the 'bots' list defines the set of allowable buildslaves. Each element is a # tuple of bot-name and bot-password. These correspond to values given to the # buildslave's mktap invocation. # quick helper to hide pwds from SVN checked-in file def read_pwd(slavename): f = file("/home/buildbot/pwds/"+slavename, "r") pwd = f.readline(); pwd = pwd.rstrip(); f.close(); return pwd c['bots'] = [ ("mc-fast", read_pwd("mc-fast")), ## ("mc-slow", read_pwd("mc-slow")), ## ("mc-slower", read_pwd("mc-slower")), ] ########################################################################### # this is the standard set of build steps, with a "make distcheck" and a # "make disttest" thrown in, along with a little extra paranoia about being # pristine beforehand, and a synch step. # the synch step is used to avoid multiple buildbots running in parallel. # steps = [ s(source.SVN, svnurl="http://svn.apache.org/repos/asf/spamassassin/trunk", mode="update"), s(shell.Configure, command="/local/perl586/bin/perl build/automc/buildbot_ready start"), s(shell.Test, command="/local/perl586/bin/perl build/automc/run_preflight"), s(shell.Configure, command="/local/perl586/bin/perl build/automc/buildbot_ready stop"), ]; bf_mc_generic = factory.BuildFactory(steps) b1 = { "name": "mc-fast", "slavename": "mc-fast", "builddir": "mc-fast", "factory": bf_mc_generic, } c['builders'].append(b1) ## b1 = { "name": "mc-slow", "slavename": "mc-slow", "builddir": "mc-slow", "factory": bf_mc_generic, } ## c['builders'].append(b1) ## b1 = { "name": "mc-slower", "slavename": "mc-slower", "builddir": "mc-slower", "factory": bf_mc_generic, } ## c['builders'].append(b1) ########################################################################### # god, why doesn't buildbot come with better examples? this could # be much easier. see # http://buildbot.sourceforge.net/manual-0.7.5.html#index-c_005b_0027schedulers_0027_005d-16 # stagger the mass-check startup times to avoid peak loads from buildbot import scheduler sched1 = scheduler.Scheduler("sched1", None, 10, ["mc-fast"]) ## sched2 = scheduler.Scheduler("sched2", None, 10*60, ["mc-slow"]) ## sched3 = scheduler.Scheduler("sched3", None, 20*60, ["mc-slower"]) ## c['schedulers'] = [sched1,sched2,sched3] c['schedulers'] = [sched1] ########################################################################### # 'slavePortnum' defines the TCP port to listen on. This must match the value # configured into the buildslaves (with their --master option) c['slavePortnum'] = 9988 # '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'] = [] c['status'].append(html.Waterfall(http_port=8011, robots_txt="/var/www/buildbot.spamassassin.org/robots.txt", css="/var/www/buildbot.spamassassin.org/buildbot.css" )) from buildbot.status import mail c['status'].append(mail.MailNotifier(fromaddr="buildbot@spamassassin.zones.apache.org", extraRecipients=["commits@spamassassin.apache.org"], mode="problem", sendToInterestedUsers=True)) # from buildbot.status import words # c['status'].append(words.IRC(host="irc.example.com", nick="bb", # channels=["#example"])) from buildbot.status import words c['status'].append(words.IRC(host="irc.us.freenode.net", nick="bbmass-bot", channels=["#spamassassin"])) # if you set 'debugPassword', then you can connect to the buildmaster with # the diagnostic tool in contrib/debugclient.py . From this tool, you can # manually force builds and inject changes, which may be useful for testing # your buildmaster without actually commiting changes to your repository (or # before you have a functioning 'sources' set up). The debug tool uses the # same port number as the slaves do: 'slavePortnum'. # c['debugPassword'] = "debugpassword" # if you set 'manhole', you can telnet into the buildmaster and get an # interactive python shell, which may be useful for debugging buildbot # internals. It is probably only useful for buildbot developers. # from buildbot.master import Manhole #c['manhole'] = Manhole(9999, "admin", "password") # 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'] = "Preflight Mass-Checks" c['projectURL'] = "http://wiki.apache.org/spamassassin/PreflightBuildBot" # the 'buildbotURL' string should point to the location where the buildbot's # internal web server is visible. This is typically at the port number set in # the Waterfall 'status' entry, but at an externally-visible host name which # the buildbot cannot on its own. c['buildbotURL'] = "http://bbmass.spamassassin.org:8011/" # finally we define the name that the buildmaster has been waiting for. BuildmasterConfig = c