]> git.evergreen-ils.org Git - OpenSRF.git/blob - examples/buildbot.cfg
Define the builders and give them a slot for username/password
[OpenSRF.git] / examples / buildbot.cfg
1 # -*- python -*-
2 # vim: set syntax=python:et:ts=4:sw=4:
3
4 # This is a sample buildmaster config file. It must be installed as
5 # 'master.cfg' in your buildmaster's base directory.
6
7 # This is the dictionary that the buildmaster pays attention to. We also use
8 # a shorter alias to save typing.
9 c = BuildmasterConfig = {}
10
11 ####### BUILDSLAVES
12
13 # The 'slaves' list defines the set of recognized buildslaves. Each element is
14 # a BuildSlave object, specifying a username and password.  The same username and
15 # password must be configured on the slave.
16 from buildbot.buildslave import BuildSlave
17 c['slaves'] = [
18     BuildSlave("opensrf-slave", "XXX", max_builds=1),
19     BuildSlave("eg-slave", "XXX", max_builds=1),
20     BuildSlave("eg-u804", "XXX", max_builds=1),
21     BuildSlave("eg-u1004", "XXX", max_builds=1)
22 ]
23
24 # 'slavePortnum' defines the TCP port to listen on for connections from slaves.
25 # This must match the value configured into the buildslaves (with their
26 # --master option)
27 c['slavePortnum'] = XXX
28
29 ####### CHANGESOURCES
30
31 # the 'change_source' setting tells the buildmaster how it should find out
32 # about source code changes.  Here we point to OpenSRF:
33 def split_file_branches_trunk(path):
34     pieces = path.split('/')
35     if pieces[0] == 'trunk':
36         return ('trunk', '/'.join(pieces[1:]))
37     elif pieces[0] == 'branches':
38         return ('/'.join(pieces[0:2]),
39                 '/'.join(pieces[2:]))
40     else:
41         return None
42
43 from buildbot.changes import svnpoller
44 c['change_source'] = (
45         svnpoller.SVNPoller(
46                 project='OpenSRF',
47                 svnurl='svn://svn.open-ils.org/OpenSRF',
48                 split_file=svnpoller.split_file_branches,
49                 pollinterval=600),
50         svnpoller.SVNPoller(
51                 project='Evergreen',
52                 svnurl='svn://svn.open-ils.org/ILS',
53                 split_file=svnpoller.split_file_branches,
54                 pollinterval=600)
55 )
56
57 ####### FILTERS
58 from buildbot.schedulers.filter import ChangeFilter
59 trunk_filter = ChangeFilter(project='OpenSRF', branch=None)
60 rel_1_6_filter = ChangeFilter(project='OpenSRF', branch="branches/rel_1_6")
61 rel_2_0_filter = ChangeFilter(project='OpenSRF', branch="branches/rel_2_0")
62 eg_rel_1_6_1_filter = ChangeFilter(project='Evergreen', branch="branches/rel_1_6_1")
63 eg_rel_2_0_filter = ChangeFilter(project='Evergreen', branch="branches/rel_2_0")
64 eg_rel_2_1_filter = ChangeFilter(project='Evergreen', branch="branches/rel_2_1")
65 eg_trunk_filter = ChangeFilter(project='Evergreen', branch=None)
66
67 ####### SCHEDULERS
68
69 # Configure the Schedulers, which decide how to react to incoming changes.  In this
70 # case, just kick off a 'runtests' build
71
72 from buildbot.scheduler import Scheduler
73 c['schedulers'] = []
74 c['schedulers'].append(Scheduler(name="osrf-trunk-full",
75             treeStableTimer=300,
76             change_filter=trunk_filter,
77             builderNames=["osrf-trunk-ubuntu-10.04-x86_64"]))
78
79 c['schedulers'].append(Scheduler(name="osrf-rel_1_6",
80             treeStableTimer=300,
81             change_filter=rel_1_6_filter,
82             builderNames=["osrf-rel_1_6-ubuntu-10.04-x86_64"]))
83
84 c['schedulers'].append(Scheduler(name="osrf-rel_2_0",
85             treeStableTimer=300,
86             change_filter=rel_2_0_filter,
87             builderNames=["osrf-rel_2_0-ubuntu-10.04-x86_64"]))
88
89 c['schedulers'].append(Scheduler(name="evergreen-rel_1_6_1",
90             treeStableTimer=300,
91             change_filter=eg_rel_1_6_1_filter,
92             builderNames=[
93                 "evergreen-rel_1_6_1-debian-6.00-x86_64",
94                 "evergreen-rel_1_6_1-ubuntu-8.04-x86",
95                 "evergreen-rel_1_6_1-ubuntu-10.04-x86"
96             ]))
97
98 c['schedulers'].append(Scheduler(name="evergreen-rel_2_0",
99             treeStableTimer=300,
100             change_filter=eg_rel_2_0_filter,
101             builderNames=[
102                 "evergreen-rel_2_0-debian-6.00-x86_64",
103                 "evergreen-rel_2_0-ubuntu-8.04-x86",
104                 "evergreen-rel_2_0-ubuntu-10.04-x86"
105             ]))
106
107 c['schedulers'].append(Scheduler(name="evergreen-rel_2_1",
108             treeStableTimer=300,
109             change_filter=eg_rel_2_1_filter,
110             builderNames=[
111                 "evergreen-rel_2_1-debian-6.00-x86_64",
112                 "evergreen-rel_2_1-ubuntu-8.04-x86",
113                 "evergreen-rel_2_1-ubuntu-10.04-x86"
114             ]))
115
116 c['schedulers'].append(Scheduler(name="evergreen-trunk",
117             treeStableTimer=300,
118             change_filter=eg_trunk_filter,
119             builderNames=[
120                 "evergreen-trunk-debian-6.00-x86_64",
121                 "evergreen-trunk-ubuntu-8.04-x86",
122                 "evergreen-trunk-ubuntu-10.04-x86"
123             ]))
124
125 ####### BUILDERS
126
127 # The 'builders' list defines the Builders, which tell Buildbot how to perform a build:
128 # what steps, and which slaves can execute them.  Note that any particular build will
129 # only take place on one slave.
130
131 from buildbot.process.factory import BuildFactory
132 from buildbot.steps import source 
133 from buildbot.steps import shell
134 from buildbot.steps import python
135 from buildbot.steps import python_twisted
136
137 osrf_factory = BuildFactory()
138 # check out the source
139 osrf_factory.addStep(source.SVN(
140             baseURL='svn://svn.open-ils.org/OpenSRF/',
141             defaultBranch='trunk',
142             mode='copy'))
143
144 # bootstrap the code
145 osrf_factory.addStep(shell.ShellCommand(command=["./autogen.sh"]))
146
147 # configure (default args for now)
148 osrf_factory.addStep(shell.Configure())
149
150 # compile the code
151 osrf_factory.addStep(shell.Compile(command=["make"]))
152
153 # run the Perl unit tests
154 osrf_factory.addStep(shell.PerlModuleTest(workdir="build/src/perl"))
155
156 # run the Python unit tests (available after rel_1_6)
157 def has_python_unit_test(step):
158     return step.build.getProperty('branch') != 'branches/rel_1_6'
159
160 osrf_factory.addStep(python_twisted.Trial(
161     doStepIf=has_python_unit_test,
162     testpath="build",
163     tests="src/python/tests/json_test.py"))
164
165 # report on the Python code
166 osrf_factory.addStep(python.PyLint(
167     env={"PYTHONPATH": ["src/python"]},
168     flunkOnFailure=False,
169     command=["pylint", 
170         "--output-format=parseable",
171         "src/python/opensrf.py",
172         "src/python/osrf/app.py",
173         "src/python/osrf/cache.py",
174         "src/python/osrf/conf.py",
175         "src/python/osrf/const.py",
176         "src/python/osrf/ex.py",
177         "src/python/osrf/gateway.py",
178         "src/python/osrf/http_translator.py",
179         "src/python/osrf/json.py",
180         "src/python/osrf/log.py",
181         "src/python/osrf/net_obj.py",
182         "src/python/osrf/net.py",
183         "src/python/osrf/server.py",
184         "src/python/osrf/ses.py",
185         "src/python/osrf/set.py",
186         "src/python/osrf/stack.py",
187         "src/python/osrf/system.py",
188         "src/python/osrf/xml_obj.py",
189         "src/python/osrf/apps/example.py"]))
190
191 eg_factory = BuildFactory()
192 # check out the source
193 eg_factory.addStep(source.SVN(
194             baseURL='svn://svn.open-ils.org/ILS/',
195             defaultBranch='trunk',
196             mode='copy'))
197
198 # bootstrap the code
199 eg_factory.addStep(shell.ShellCommand(command=["./autogen.sh"]))
200
201 # configure (default args for now)
202 eg_factory.addStep(shell.Configure())
203
204 # compile the code
205 eg_factory.addStep(shell.Compile(command=["make"]))
206
207 perldir = 'build/Open-ILS/src/perlmods'
208 class PerlModuleTestMFHDMadness(shell.PerlModuleTest):
209     'Override PerlModuleTest with nonstandard library location for testlib.pm'
210     command = ['prove', '--lib', 'lib', '-I', 'lib/OpenILS/Utils/MFHD/test', '-r', 't']
211     total = 0
212
213 def has_perl_unit_tests(step):
214     'Only run Perl tests if there are tests'
215     if (step.build.getProperty('branch') == 'branches/rel_1_6_1'):
216         return False
217     elif (step.build.getProperty('branch') == 'branches/rel_2_0'):
218         return False
219     return True
220
221 # run the Perl unit tests
222 eg_factory.addStep(PerlModuleTestMFHDMadness(
223     doStepIf=has_perl_unit_tests,
224     workdir=perldir)
225 )
226
227 # report on the Python code
228 eg_factory.addStep(python.PyLint(
229     env={"PYTHONPATH": ["Open-ILS/src/python"]},
230     flunkOnFailure=False,
231     command=["pylint", 
232         "--output-format=parseable",
233         "Open-ILS/src/python/setup.py",
234         "Open-ILS/src/python/oils/const.py",
235         "Open-ILS/src/python/oils/event.py",
236         "Open-ILS/src/python/oils/__init__.py",
237         "Open-ILS/src/python/oils/org.py",
238         "Open-ILS/src/python/oils/srfsh.py",
239         "Open-ILS/src/python/oils/system.py",
240         "Open-ILS/src/python/oils/utils/csedit.py",
241         "Open-ILS/src/python/oils/utils/idl.py",
242         "Open-ILS/src/python/oils/utils/__init__.py",
243         "Open-ILS/src/python/oils/utils/utils.py"
244     ]
245 ))
246
247 from buildbot.config import BuilderConfig
248
249 c['builders'] = []
250 c['builders'].append(
251     BuilderConfig(name="osrf-trunk-ubuntu-10.04-x86_64",
252       slavenames=["opensrf-slave"],
253       factory=osrf_factory))
254 c['builders'].append(
255     BuilderConfig(name="osrf-rel_1_6-ubuntu-10.04-x86_64",
256       slavenames=["opensrf-slave"],
257       factory=osrf_factory))
258 c['builders'].append(
259     BuilderConfig(name="osrf-rel_2_0-ubuntu-10.04-x86_64",
260       slavenames=["opensrf-slave"],
261       factory=osrf_factory))
262
263 # UPEI Debian 6.00
264 c['builders'].append(
265     BuilderConfig(name="evergreen-rel_1_6_1-debian-6.00-x86_64",
266       slavenames=["eg-slave"],
267       factory=eg_factory))
268 c['builders'].append(
269     BuilderConfig(name="evergreen-rel_2_0-debian-6.00-x86_64",
270       slavenames=["eg-slave"],
271       factory=eg_factory))
272 c['builders'].append(
273     BuilderConfig(name="evergreen-rel_2_1-debian-6.00-x86_64",
274       slavenames=["eg-slave"],
275       factory=eg_factory))
276 c['builders'].append(
277     BuilderConfig(name="evergreen-trunk-debian-6.00-x86_64",
278       slavenames=["eg-slave"],
279       factory=eg_factory))
280
281 # GPLS Ubuntu 8.04
282 c['builders'].append(
283     BuilderConfig(name="evergreen-rel_1_6_1-ubuntu-8.04-x86",
284       slavenames=["eg-u804"],
285       factory=eg_factory))
286 c['builders'].append(
287     BuilderConfig(name="evergreen-rel_2_0-ubuntu-8.04-x86",
288       slavenames=["eg-u804"],
289       factory=eg_factory))
290 c['builders'].append(
291     BuilderConfig(name="evergreen-rel_2_1-ubuntu-8.04-x86",
292       slavenames=["eg-u804"],
293       factory=eg_factory))
294 c['builders'].append(
295     BuilderConfig(name="evergreen-trunk-ubuntu-8.04-x86",
296       slavenames=["eg-u804"],
297       factory=eg_factory))
298
299 # GPLS Ubuntu 8.04
300 c['builders'].append(
301     BuilderConfig(name="evergreen-rel_1_6_1-ubuntu-10.04-x86",
302       slavenames=["eg-u1004"],
303       factory=eg_factory))
304 c['builders'].append(
305     BuilderConfig(name="evergreen-rel_2_0-ubuntu-10.04-x86",
306       slavenames=["eg-u1004"],
307       factory=eg_factory))
308 c['builders'].append(
309     BuilderConfig(name="evergreen-rel_2_1-ubuntu-10.04-x86",
310       slavenames=["eg-u1004"],
311       factory=eg_factory))
312 c['builders'].append(
313     BuilderConfig(name="evergreen-trunk-ubuntu-10.04-x86",
314       slavenames=["eg-u1004"],
315       factory=eg_factory))
316
317 ####### STATUS TARGETS
318
319 # 'status' is a list of Status Targets. The results of each build will be
320 # pushed to these targets. buildbot/status/*.py has a variety to choose from,
321 # including web pages, email senders, and IRC bots.
322
323 c['status'] = []
324
325 from buildbot.status import html
326 from buildbot.status.web import auth, authz
327
328 users = [('XXX', 'XXX'), ('XXX', 'XXX')]
329 authz_cfg=authz.Authz(
330     auth=auth.BasicAuth(users),
331     # change any of these to True to enable; see the manual for more
332     # options
333     gracefulShutdown = False,
334     forceBuild = 'auth', # use this to test your slave once it is set up
335     forceAllBuilds = False,
336     pingBuilder = False,
337     stopBuild = False,
338     stopAllBuilds = False,
339     cancelPendingBuild = False,
340 )
341 c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg))
342
343 # Send mail when a build is broken
344 from buildbot.status.mail import MailNotifier
345 mn = MailNotifier(
346     fromaddr="buildbot@testing.esilibrary.com",
347     sendToInterestedUsers=False,
348     mode='problem',
349     extraRecipients=["dan@coffeecode.net","open-ils-dev@list.georgialibraries.org"])
350
351 # Uncomment to actually send mail
352 # c['status'].append(mn)
353
354 ####### PROJECT IDENTITY
355
356 # the 'projectName' string will be used to describe the project that this
357 # buildbot is working on. For example, it is used as the title of the
358 # waterfall HTML page. The 'projectURL' string will be used to provide a link
359 # from buildbot HTML pages to your project's home page.
360
361 c['projectName'] = "Evergreen and OpenSRF"
362 c['projectURL'] = "http://evergreen-ils.org/"
363
364 # the 'buildbotURL' string should point to the location where the buildbot's
365 # internal web server (usually the html.WebStatus page) is visible. This
366 # typically uses the port number set in the Waterfall 'status' entry, but
367 # with an externally-visible host name which the buildbot cannot figure out
368 # without some help.
369
370 c['buildbotURL'] = "http://testing.evergreen-ils.org/buildbot/"
371
372 ####### DB URL
373
374 # This specifies what database buildbot uses to store change and scheduler
375 # state.  You can leave this at its default for all but the largest
376 # installations.
377 c['db_url'] = "sqlite:///state.sqlite"
378