add max_builds= to BuildSlave, thanks to Dustin Mitchell. Closes #48.
[buildbot.git] / buildbot / scripts / sample.cfg
blob311fda0ccce2cc7e1621e5aebee2eb14bd06f04e
1 # -*- python -*-
2 # ex: set syntax=python:
4 # This is a sample buildmaster config file. It must be installed as
5 # 'master.cfg' in your buildmaster's base directory (although the filename
6 # can be changed with the --basedir option to 'mktap buildbot master').
8 # It has one job: define a dictionary named BuildmasterConfig. This
9 # dictionary has a variety of keys to control different aspects of the
10 # buildmaster. They are documented in docs/config.xhtml .
13 # This is the dictionary that the buildmaster pays attention to. We also use
14 # a shorter alias to save typing.
15 c = BuildmasterConfig = {}
17 ####### BUILDSLAVES
19 # the 'slaves' list defines the set of allowable buildslaves. Each element is
20 # a tuple of bot-name and bot-password. These correspond to values given to
21 # the buildslave's mktap invocation.
22 from buildbot.buildslave import BuildSlave
23 c['slaves'] = [BuildSlave("bot1name", "bot1passwd")]
25 # to limit to two concurrent builds on a slave, use
26 #  c['slaves'] = [BuildSlave("bot1name", "bot1passwd", max_builds=2)]
29 # 'slavePortnum' defines the TCP port to listen on. This must match the value
30 # configured into the buildslaves (with their --master option)
32 c['slavePortnum'] = 9989
34 ####### CHANGESOURCES
36 # the 'change_source' setting tells the buildmaster how it should find out
37 # about source code changes. Any class which implements IChangeSource can be
38 # put here: there are several in buildbot/changes/*.py to choose from.
40 from buildbot.changes.pb import PBChangeSource
41 c['change_source'] = PBChangeSource()
43 # For example, if you had CVSToys installed on your repository, and your
44 # CVSROOT/freshcfg file had an entry like this:
45 #pb = ConfigurationSet([
46 #    (None, None, None, PBService(userpass=('foo', 'bar'), port=4519)),
47 #    ])
49 # then you could use the following buildmaster Change Source to subscribe to
50 # the FreshCVS daemon and be notified on every commit:
52 #from buildbot.changes.freshcvs import FreshCVSSource
53 #fc_source = FreshCVSSource("cvs.example.com", 4519, "foo", "bar")
54 #c['change_source'] = fc_source
56 # or, use a PBChangeSource, and then have your repository's commit script run
57 # 'buildbot sendchange', or use contrib/svn_buildbot.py, or
58 # contrib/arch_buildbot.py :
60 #from buildbot.changes.pb import PBChangeSource
61 #c['change_source'] = PBChangeSource()
64 ####### SCHEDULERS
66 ## configure the Schedulers
68 from buildbot.scheduler import Scheduler
69 c['schedulers'] = []
70 c['schedulers'].append(Scheduler(name="all", branch=None,
71                                  treeStableTimer=2*60,
72                                  builderNames=["buildbot-full"]))
75 ####### BUILDERS
77 # the 'builders' list defines the Builders. Each one is configured with a
78 # dictionary, using the following keys:
79 #  name (required): the name used to describe this bilder
80 #  slavename (required): which slave to use, must appear in c['bots']
81 #  builddir (required): which subdirectory to run the builder in
82 #  factory (required): a BuildFactory to define how the build is run
83 #  periodicBuildTime (optional): if set, force a build every N seconds
85 # buildbot/process/factory.py provides several BuildFactory classes you can
86 # start with, which implement build processes for common targets (GNU
87 # autoconf projects, CPAN perl modules, etc). The factory.BuildFactory is the
88 # base class, and is configured with a series of BuildSteps. When the build
89 # is run, the appropriate buildslave is told to execute each Step in turn.
91 # the first BuildStep is typically responsible for obtaining a copy of the
92 # sources. There are source-obtaining Steps in buildbot/process/step.py for
93 # CVS, SVN, and others.
95 cvsroot = ":pserver:anonymous@cvs.sourceforge.net:/cvsroot/buildbot"
96 cvsmodule = "buildbot"
98 from buildbot.process import factory
99 from buildbot.steps.source import CVS
100 from buildbot.steps.shell import Compile
101 from buildbot.steps.python_twisted import Trial
102 f1 = factory.BuildFactory()
103 f1.addStep(CVS,
104            cvsroot=cvsroot, cvsmodule=cvsmodule, login="",
105            mode="copy")
106 f1.addStep(Compile, command=["./setup.py", "build"])
107 f1.addStep(Trial, testpath=".")
109 b1 = {'name': "buildbot-full",
110       'slavename': "bot1name",
111       'builddir': "full",
112       'factory': f1,
113       }
114 c['builders'] = [b1]
117 ####### STATUS TARGETS
119 # 'status' is a list of Status Targets. The results of each build will be
120 # pushed to these targets. buildbot/status/*.py has a variety to choose from,
121 # including web pages, email senders, and IRC bots.
123 c['status'] = []
125 from buildbot.status import html
126 c['status'].append(html.Waterfall(http_port=8010))
128 # from buildbot.status import mail
129 # c['status'].append(mail.MailNotifier(fromaddr="buildbot@localhost",
130 #                                      extraRecipients=["builds@example.com"],
131 #                                      sendToInterestedUsers=False))
133 # from buildbot.status import words
134 # c['status'].append(words.IRC(host="irc.example.com", nick="bb",
135 #                              channels=["#example"]))
137 # from buildbot.status import client
138 # c['status'].append(client.PBListener(9988))
141 ####### DEBUGGING OPTIONS
143 # if you set 'debugPassword', then you can connect to the buildmaster with
144 # the diagnostic tool in contrib/debugclient.py . From this tool, you can
145 # manually force builds and inject changes, which may be useful for testing
146 # your buildmaster without actually commiting changes to your repository (or
147 # before you have a functioning 'sources' set up). The debug tool uses the
148 # same port number as the slaves do: 'slavePortnum'.
150 #c['debugPassword'] = "debugpassword"
152 # if you set 'manhole', you can ssh into the buildmaster and get an
153 # interactive python shell, which may be useful for debugging buildbot
154 # internals. It is probably only useful for buildbot developers. You can also
155 # use an authorized_keys file, or plain telnet.
156 #from buildbot import manhole
157 #c['manhole'] = manhole.PasswordManhole("tcp:9999:interface=127.0.0.1",
158 #                                       "admin", "password")
161 ####### PROJECT IDENTITY
163 # the 'projectName' string will be used to describe the project that this
164 # buildbot is working on. For example, it is used as the title of the
165 # waterfall HTML page. The 'projectURL' string will be used to provide a link
166 # from buildbot HTML pages to your project's home page.
168 c['projectName'] = "Buildbot"
169 c['projectURL'] = "http://buildbot.sourceforge.net/"
171 # the 'buildbotURL' string should point to the location where the buildbot's
172 # internal web server (usually the html.Waterfall page) is visible. This
173 # typically uses the port number set in the Waterfall 'status' entry, but
174 # with an externally-visible host name which the buildbot cannot figure out
175 # without some help.
177 c['buildbotURL'] = "http://localhost:8010/"