#! /usr/bin/python # 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.changes.freshcvs import FreshCVSSource # thomas: added for svn_buildbot.py from buildbot.changes.pb import PBChangeSource from buildbot.process import step, factory, base from buildbot.fluendo import step as fstep reload(fstep) from buildbot.status import html s = factory.s # to save typing, we create a dictionary named 'c' and rename it later c = {} # 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. c['bots'] = [("bot1name", "bot1passwd")] # the 'sources' list tells the buildmaster how it should find out about # source code changes. Any class which implements IChangeSource can be added # to this list: there are several in buildbot/changes/*.py to choose from. c['sources'] = [] # thomas: added c['sources'].append(PBChangeSource(prefix="")) # For example, if you had CVSToys installed on your repository, and your # CVSROOT/freshcfg file had an entry like this: #pb = ConfigurationSet([ # (None, None, None, PBService(userpass=('foo', 'bar'), port=4519)), # ]) # then you could use the following buildmaster Change Source to subscribe to # the FreshCVS daemon and be notified on every commit: # #fc_source = FreshCVSSource("cvs.example.com", 4519, "foo", "bar") #c['sources'].append(fc_source) # 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. svnroot = "file:///home/svn" svnproject = "test" # project root svntype = "trunk" # trunk/branches/tags/... builders = [] svnmodule = "test1" # underneath the project root if there is a div source = s(step.SVN, svnurl=os.path.join(svnroot, svnproject, svnmodule, svntype), mode="update") class LoggingBuild(base.Build): def isFileImportant(self, filename): log.msg('is "%s" important ?' % filename) return 1 class LoggingBuildFactory(factory.BuildFactory): buildClass = LoggingBuild steps = [source, s(fstep.FindPkgConfigPath), s(fstep.IncMake), s(fstep.AutogenAfterIncMake, options=[ "--prefix=/tmp/prefix" ]), s(fstep.CompileAfterIncMake), s(fstep.Make, target="check", haltOnFailure=1), s(fstep.Make, target="distcheck", haltOnFailure=1), s(fstep.RpmBuild, haltOnFailure=1), # s(fstep.MachRpmBuild, root="f3g", haltOnFailure=1), ] f1 = LoggingBuildFactory(steps) b1 = {'name': "test", 'slavename': "bot1name", 'builddir': "test", 'factory': f1, } # autogen test steps = [source, s(fstep.Autogen, options=[ "--prefix=/tmp/prefix" ]), s(fstep.Make, haltOnFailure=1), s(fstep.Make, target="check", haltOnFailure=1), s(fstep.Make, target="distcheck", haltOnFailure=1), s(fstep.RpmBuild, haltOnFailure=1), ] f1a = LoggingBuildFactory(steps) b1a = {'name': "test-autogen", 'slavename': "bot1name", 'builddir': "test-autogen", 'factory': f1a, } # the trash test steps = [ #source, s(step.ShellCommand, command="umask && rm -f k && touch k && ls -l k"), s(step.ShellCommand, command="umask 0000"), s(step.ShellCommand, command="umask && rm -f k && touch k && ls -l k"), ] f1t = LoggingBuildFactory(steps) b1t = {'name': "test-trash", 'slavename': "bot1name", 'builddir': "test-trash", 'factory': f1t, } svnmodule = "test2" # underneath the project root if there is a div source = s(step.SVN, svnurl=os.path.join(svnroot, svnproject, svnmodule, svntype), mode="update") steps = [source, s(fstep.IncMake), s(fstep.AutogenAfterIncMake, options=[ "--prefix=/tmp/prefix" ]), s(fstep.CompileAfterIncMake), s(fstep.Make, target="check", haltOnFailure=1), s(fstep.Make, target="distcheck", haltOnFailure=1), ] f2 = LoggingBuildFactory(steps) b2 = {'name': "test.DEVEL", 'slavename': "bot1name", 'builddir': "test.DEVEL", 'factory': f2, } c['builders'] = [b1, b1a, b1t, b2] # 'slavePortnum' defines the TCP port to listen on. This must match the value # configured into the buildslaves (with their --master option) c['slavePortnum'] = 9989 # '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=8010)) from buildbot.status import words c['status'].append(words.IRC(host="irc.freenode.net", nick='twistbot', channels=["fluendo"], )) # feature from other branch # config="words.cfg")) # from buildbot.status import mail # c['status'].append(mail.MailNotifier(fromaddr="buildbot@localhost", # extraRecipients=["builds@example.com"], # sendToInterestedUsers=False)) # from buildbot.status import words # c['status'].append(words.IRC(host="irc.example.com", nick="bb", # channels=["#example"])) # 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'] = "Buildbot" c['projectURL'] = "http://buildbot.sourceforge.net/" # 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://localhost:8080/" # finally we define the name that the buildmaster has been waiting for. BuildmasterConfig = c