Merge branch 'web-improvements' of git://github.com/catlee/buildbot
[buildbot.git] / docs / examples / twisted_master.cfg
blob7185ef354414e9ea7b1e4fa6f96117df70228499
1 #! /usr/bin/python
3 # NOTE: this configuration file is from the buildbot-0.7.5 era or earlier. It
4 # has not been brought up-to-date with the standards of buildbot-0.7.6 . For
5 # examples of modern usage, please see hello.cfg, or the sample.cfg which is
6 # installed when you run 'buildbot create-master'.
8 # This configuration file is described in $BUILDBOT/docs/config.xhtml
10 # This is used (with online=True) to run the Twisted Buildbot at
11 # http://www.twistedmatrix.com/buildbot/ . Passwords and other secret
12 # information are loaded from a neighboring file called 'private.py'.
14 import sys
15 sys.path.append('/home/buildbot/BuildBot/support-master')
17 import os.path
19 from buildbot.changes.pb import PBChangeSource
20 from buildbot.scheduler import Scheduler, Try_Userpass
21 from buildbot.steps.source import SVN
22 from buildbot.process.factory import s
23 from buildbot.process.process_twisted import \
24 QuickTwistedBuildFactory, \
25 FullTwistedBuildFactory, \
26 TwistedReactorsBuildFactory
27 from buildbot.status import html, words, client, mail
29 import extra_factory
30 reload(extra_factory)
31 from extra_factory import GoodTwistedBuildFactory
33 import private # holds passwords
34 reload(private) # make it possible to change the contents without a restart
36 BuildmasterConfig = c = {}
38 # I set really=False when testing this configuration at home
39 really = True
40 usePBChangeSource = True
43 c['bots'] = []
44 for bot in private.bot_passwords.keys():
45 c['bots'].append((bot, private.bot_passwords[bot]))
47 c['sources'] = []
49 # the Twisted buildbot currently uses the contrib/svn_buildbot.py script.
50 # This makes a TCP connection to the ChangeMaster service to push Changes
51 # into the build master. The script is invoked by
52 # /svn/Twisted/hooks/post-commit, so it will only be run for things inside
53 # the Twisted repository. However, the standard SVN practice is to put the
54 # actual trunk in a subdirectory named "trunk/" (to leave room for
55 # "branches/" and "tags/"). We want to only pay attention to the trunk, so
56 # we use "trunk" as a prefix for the ChangeSource. This also strips off that
57 # prefix, so that the Builders all see sensible pathnames (which means they
58 # can do things like ignore the sandbox properly).
60 source = PBChangeSource(prefix="trunk/")
61 c['sources'].append(source)
64 ## configure the builders
66 if 0:
67 # always build on trunk
68 svnurl = "svn://svn.twistedmatrix.com/svn/Twisted/trunk"
69 source_update = s(SVN, svnurl=svnurl, mode="update")
70 source_copy = s(SVN, svnurl=svnurl, mode="copy")
71 source_export = s(SVN, svnurl=svnurl, mode="export")
72 else:
73 # for build-on-branch, we use these instead
74 baseURL = "svn://svn.twistedmatrix.com/svn/Twisted/"
75 defaultBranch = "trunk"
76 source_update = s(SVN, baseURL=baseURL, defaultBranch=defaultBranch,
77 mode="update")
78 source_copy = s(SVN, baseURL=baseURL, defaultBranch=defaultBranch,
79 mode="copy")
80 source_export = s(SVN, baseURL=baseURL, defaultBranch=defaultBranch,
81 mode="export")
84 builders = []
88 b24compile_opts = [
89 "-Wignore::PendingDeprecationWarning:distutils.command.build_py",
90 "-Wignore::PendingDeprecationWarning:distutils.command.build_ext",
94 b25compile_opts = b24compile_opts # FIXME
97 b1 = {'name': "quick",
98 'slavename': "bot1",
99 'builddir': "quick",
100 'factory': QuickTwistedBuildFactory(source_update,
101 python=["python2.3", "python2.4"]),
103 builders.append(b1)
105 b23compile_opts = [
106 "-Wignore::PendingDeprecationWarning:distutils.command.build_py",
107 "-Wignore::PendingDeprecationWarning:distutils.command.build_ext",
109 b23 = {'name': "debian-py2.3-select",
110 'slavename': "bot-exarkun",
111 'builddir': "full2.3",
112 'factory': FullTwistedBuildFactory(source_copy,
113 python=["python2.3", "-Wall"],
114 # use -Werror soon
115 compileOpts=b23compile_opts,
116 processDocs=1,
117 runTestsRandomly=1),
119 builders.append(b23)
121 b24 = {'name': "debian-py2.4-select",
122 'slavenames': ["bot-exarkun"],
123 'builddir': "full2.4",
124 'factory': FullTwistedBuildFactory(source_copy,
125 python=["python2.4", "-Wall"],
126 # use -Werror soon
127 compileOpts=b24compile_opts,
128 runTestsRandomly=1),
130 builders.append(b24)
132 b24debian64 = {
133 'name': 'debian64-py2.4-select',
134 'slavenames': ['bot-idnar-debian64'],
135 'builddir': 'full2.4-debian64',
136 'factory': FullTwistedBuildFactory(source_copy,
137 python=["python2.4", "-Wall"],
138 compileOpts=b24compile_opts),
140 builders.append(b24debian64)
142 b25debian = {
143 'name': 'debian-py2.5-select',
144 'slavenames': ['bot-idnar-debian'],
145 'builddir': 'full2.5-debian',
146 'factory': FullTwistedBuildFactory(source_copy,
147 python=["python2.5", "-Wall"],
148 compileOpts=b24compile_opts)}
149 builders.append(b25debian)
152 b25suse = {
153 'name': 'suse-py2.5-select',
154 'slavenames': ['bot-scmikes-2.5'],
155 'builddir': 'bot-scmikes-2.5',
156 'factory': FullTwistedBuildFactory(source_copy,
157 python=["python2.5", "-Wall"],
158 compileOpts=b24compile_opts),
160 builders.append(b25suse)
162 reactors = ['poll', 'epoll', 'gtk', 'gtk2']
163 b4 = {'name': "debian-py2.4-reactors",
164 'slavename': "bot2",
165 'builddir': "reactors",
166 'factory': TwistedReactorsBuildFactory(source_copy,
167 python="python2.4",
168 reactors=reactors),
170 builders.append(b4)
172 bosx24 = {
173 'name': 'osx-py2.4-select',
174 'slavenames': ['bot-exarkun-osx'],
175 'builddir': 'full2.4-exarkun-osx',
176 'factory': FullTwistedBuildFactory(source_copy,
177 python=["python2.4", "-Wall"],
178 compileOpts=b24compile_opts,
179 runTestsRandomly=1)}
180 builders.append(bosx24)
182 forcegc = {
183 'name': 'osx-py2.4-select-gc',
184 'slavenames': ['bot-exarkun-osx'],
185 'builddir': 'full2.4-force-gc-exarkun-osx',
186 'factory': GoodTwistedBuildFactory(source_copy,
187 python="python2.4")}
188 builders.append(forcegc)
191 # debuild is offline while we figure out how to build 2.0 .debs from SVN
192 # b3 = {'name': "debuild",
193 # 'slavename': "bot2",
194 # 'builddir': "debuild",
195 # 'factory': TwistedDebsBuildFactory(source_export,
196 # python="python2.4"),
198 # builders.append(b3)
200 b24w32_scmikes_select = {
201 'name': "win32-py2.4-select",
202 'slavename': "bot-scmikes-win32",
203 'builddir': "W32-full2.4-scmikes-select",
204 'factory': TwistedReactorsBuildFactory(source_copy,
205 python="python",
206 compileOpts2=["-c","mingw32"],
207 reactors=["default"]),
209 builders.append(b24w32_scmikes_select)
211 b25w32_scmikes_select = {
212 'name': "win32-py2.5-select",
213 'slavename': "bot-scmikes-win32-2.5",
214 'builddir': "W32-full2.5-scmikes-select",
215 'factory': TwistedReactorsBuildFactory(source_copy,
216 python="python",
217 compileOpts2=["-c","mingw32"],
218 reactors=["default"]),
220 builders.append(b25w32_scmikes_select)
222 b24w32_win32er = {
223 'name': "win32-py2.4-er",
224 'slavename': "bot-win32-win32er",
225 'builddir': "W32-full2.4-win32er",
226 'factory': TwistedReactorsBuildFactory(source_copy,
227 python="python",
228 compileOpts2=["-c","mingw32"],
229 reactors=["win32"]),
231 builders.append(b24w32_win32er)
234 b24w32_iocp = {
235 'name': "win32-py2.4-iocp",
236 'slavename': "bot-win32-iocp",
237 'builddir': "W32-full2.4-iocp",
238 'factory': TwistedReactorsBuildFactory(source_copy,
239 python="python",
240 compileOpts2=[],
241 reactors=["iocp"]),
243 builders.append(b24w32_iocp)
246 b24freebsd = {'name': "freebsd-py2.4-select-kq",
247 'slavename': "bot-landonf",
248 'builddir': "freebsd-full2.4",
249 'factory':
250 TwistedReactorsBuildFactory(source_copy,
251 python="python2.4",
252 reactors=["default",
253 "kqueue",
256 builders.append(b24freebsd)
259 osxtsr = {'name': "osx-py2.4-tsr",
260 'slavename': "bot-exarkun-osx",
261 'builddir': "osx-tsr",
262 'factory': TwistedReactorsBuildFactory(
263 source_copy,
264 python="python2.4",
265 reactors=["tsr"])}
266 builders.append(osxtsr)
269 bpypyc = {'name': 'osx-pypyc-select',
270 'slavename': 'bot-jerub-pypy',
271 'builddir': 'pypy-c',
272 'factory': TwistedReactorsBuildFactory(source_copy,
273 python="pypy-c",
274 reactors=["default"])}
275 builders.append(bpypyc)
277 c['builders'] = builders
279 # now set up the schedulers. We do this after setting up c['builders'] so we
280 # can auto-generate a list of all of them.
281 all_builders = [b['name'] for b in c['builders']]
282 all_builders.sort()
283 all_builders.remove("quick")
285 ## configure the schedulers
286 s_quick = Scheduler(name="quick", branch=None, treeStableTimer=30,
287 builderNames=["quick"])
288 s_try = Try_Userpass("try", all_builders, port=9989,
289 userpass=private.try_users)
291 s_all = []
292 for i, builderName in enumerate(all_builders):
293 s_all.append(Scheduler(name="all-" + builderName,
294 branch=None, builderNames=[builderName],
295 treeStableTimer=(5 * 60 + i * 30)))
296 c['schedulers'] = [s_quick, s_try] + s_all
300 # configure other status things
302 c['slavePortnum'] = 9987
303 c['status'] = []
304 if really:
305 p = os.path.expanduser("~/.twistd-web-pb")
306 c['status'].append(html.Waterfall(distrib_port=p))
307 else:
308 c['status'].append(html.Waterfall(http_port=9988))
309 if really:
310 c['status'].append(words.IRC(host="irc.freenode.net",
311 nick='buildbot',
312 channels=["twisted"]))
314 c['debugPassword'] = private.debugPassword
315 #c['interlocks'] = [("do-deb", ["full-2.2"], ["debuild"])]
316 if hasattr(private, "manhole"):
317 from buildbot import manhole
318 c['manhole'] = manhole.PasswordManhole(*private.manhole)
319 c['status'].append(client.PBListener(9936))
320 m = mail.MailNotifier(fromaddr="buildbot@twistedmatrix.com",
321 builders=["quick", "debian-py2.3-select"],
322 sendToInterestedUsers=True,
323 extraRecipients=["warner@lothar.com"],
324 mode="problem",
326 c['status'].append(m)
327 c['projectName'] = "Twisted"
328 c['projectURL'] = "http://twistedmatrix.com/"
329 c['buildbotURL'] = "http://twistedmatrix.com/buildbot/"