2 # vim: set syntax=python:et:ts=4:sw=4:
4 # This is a sample buildmaster config file. It must be installed as
5 # 'master.cfg' in your buildmaster's base directory.
7 # This is the dictionary that the buildmaster pays attention to. We also use
8 # a shorter alias to save typing.
9 c = BuildmasterConfig = {}
11 # WORKDIR must be an absolute path that is not volatile; systems
12 # like Ubuntu wipe /tmp/ on a reboot, for example, which is
13 # disastrous for build history, at least for gitpoller
14 WORKDIR = '/home/buildmaster/'
18 # The 'slaves' list defines the set of recognized buildslaves. Each element is
19 # a BuildSlave object, specifying a username and password. The same username and
20 # password must be configured on the slave.
21 from buildbot.buildslave import BuildSlave
23 BuildSlave("opensrf-slave", "XXX", max_builds=1),
24 BuildSlave("eg-slave", "XXX", max_builds=1),
25 BuildSlave("eg-u1004", "XXX", max_builds=1)
28 # 'slavePortnum' defines the TCP port to listen on for connections from slaves.
29 # This must match the value configured into the buildslaves (with their
31 c['slavePortnum'] = XXX
33 # Branches and distros to build
34 OSRF_BRANCHES = ('master', 'rel_2_1', 'rel_2_0')
35 OSRF_DISTROS = [('ubuntu-10.04-x86_64', 'opensrf-slave')]
36 EG_BRANCHES = ('master', 'rel_2_2', 'rel_2_0', 'rel_2_1')
38 ('debian-6.00-x86_64', 'eg-slave'), # UPEI
39 ('ubuntu-10.04-x86', 'eg-u1004') # GPLS
42 eg_git = 'git://git.evergreen-ils.org/Evergreen.git'
43 osrf_git = 'git://git.evergreen-ils.org/OpenSRF.git'
47 # the 'change_source' setting tells the buildmaster how it should find out
48 # about source code changes
50 from buildbot.changes import gitpoller
51 c['change_source'] = []
52 for osrf_branch in OSRF_BRANCHES:
53 c['change_source'].append(gitpoller.GitPoller(
56 workdir= WORKDIR + 'buildbot_osrf_' + osrf_branch,
60 for eg_branch in EG_BRANCHES:
61 c['change_source'].append(gitpoller.GitPoller(
64 workdir= WORKDIR + 'buildbot_eg_' + eg_branch,
69 from buildbot.changes.filter import ChangeFilter
70 master_filter = ChangeFilter(project='OpenSRF', branch="master")
71 rel_2_0_filter = ChangeFilter(project='OpenSRF', branch="rel_2_0")
72 rel_2_1_filter = ChangeFilter(project='OpenSRF', branch="rel_2_1")
73 eg_rel_2_0_filter = ChangeFilter(project='Evergreen', branch="rel_2_0")
74 eg_rel_2_1_filter = ChangeFilter(project='Evergreen', branch="rel_2_1")
75 eg_rel_2_2_filter = ChangeFilter(project='Evergreen', branch="rel_2_2")
76 eg_master_filter = ChangeFilter(project='Evergreen', branch="master")
80 # Configure the Schedulers, which decide how to react to incoming changes. In this
81 # case, just kick off a 'runtests' build
83 from buildbot.schedulers.basic import SingleBranchScheduler
85 c['schedulers'].append(SingleBranchScheduler(name="osrf-master-full",
87 change_filter=master_filter,
88 builderNames=["osrf-master-ubuntu-10.04-x86_64"]))
90 c['schedulers'].append(SingleBranchScheduler(name="osrf-rel_2_1",
92 change_filter=rel_2_1_filter,
93 builderNames=["osrf-rel_2_1-ubuntu-10.04-x86_64"]))
95 c['schedulers'].append(SingleBranchScheduler(name="osrf-rel_2_0",
97 change_filter=rel_2_0_filter,
98 builderNames=["osrf-rel_2_0-ubuntu-10.04-x86_64"]))
100 c['schedulers'].append(SingleBranchScheduler(name="evergreen-rel_2_2",
102 change_filter=eg_rel_2_2_filter,
104 "evergreen-rel_2_2-debian-6.00-x86_64",
105 "evergreen-rel_2_2-ubuntu-10.04-x86"
108 c['schedulers'].append(SingleBranchScheduler(name="evergreen-rel_2_0",
110 change_filter=eg_rel_2_0_filter,
112 "evergreen-rel_2_0-debian-6.00-x86_64",
113 "evergreen-rel_2_0-ubuntu-10.04-x86"
116 c['schedulers'].append(SingleBranchScheduler(name="evergreen-rel_2_1",
118 change_filter=eg_rel_2_1_filter,
120 "evergreen-rel_2_1-debian-6.00-x86_64",
121 "evergreen-rel_2_1-ubuntu-10.04-x86"
124 c['schedulers'].append(SingleBranchScheduler(name="evergreen-master",
126 change_filter=eg_master_filter,
128 "evergreen-master-debian-6.00-x86_64",
129 "evergreen-master-ubuntu-10.04-x86"
132 #### Build step tests
133 def eg_requires_autogen(step):
134 'Old versions of Evergreen require autogen.sh to bootstrap'
135 if (step.build.getProperty('branch') == 'rel_2_0' or
136 step.build.getProperty('branch') == 'rel_2_1'
141 def eg_requires_autoreconf(step):
142 'Modern versions of Evergreen use autoreconf to bootstrap'
143 if eg_requires_autogen(step):
147 def has_perl_unit_tests(step):
148 'Only run Perl tests if there are tests'
149 if (step.build.getProperty('branch') == 'rel_2_0'):
153 def osrf_requires_autogen(step):
154 'Old versions of OpenSRF require autogen.sh to bootstrap'
155 if (step.build.getProperty('branch') == 'rel_2_0'):
159 def osrf_requires_autoreconf(step):
160 'Modern versions of OpenSRF use autoreconf to bootstrap'
161 if osrf_requires_autogen(step):
167 # The 'builders' list defines the Builders, which tell Buildbot how to perform a build:
168 # what steps, and which slaves can execute them. Note that any particular build will
169 # only take place on one slave.
171 from buildbot.process.factory import BuildFactory
172 from buildbot.steps import source
173 from buildbot.steps import shell
174 from buildbot.steps import python
175 from buildbot.steps import python_twisted
177 osrf_factory = BuildFactory()
178 # check out the source
179 osrf_factory.addStep(source.Git(
184 # bootstrap the code - old branches require autogen.sh
185 osrf_factory.addStep(
186 shell.ShellCommand(command=["./autogen.sh"],
187 doStepIf=osrf_requires_autogen,
188 name="Bootstrap via autogen"
192 osrf_factory.addStep(
193 shell.ShellCommand(command=["autoreconf", "-f", "-i"],
194 doStepIf=osrf_requires_autoreconf,
195 name="Bootstrap via autoreconf"
199 # configure (default args for now)
200 osrf_factory.addStep(shell.Configure())
203 osrf_factory.addStep(shell.Compile(command=["make"]))
205 # run the Perl unit tests
206 osrf_factory.addStep(shell.PerlModuleTest(workdir="build/src/perl"))
208 osrf_factory.addStep(python_twisted.Trial(
210 tests="src/python/tests/json_test.py"))
212 # report on the Python code
213 osrf_factory.addStep(python.PyLint(
214 env={"PYTHONPATH": ["src/python"]},
215 flunkOnFailure=False,
217 "--output-format=parseable",
218 "src/python/opensrf.py",
219 "src/python/osrf/app.py",
220 "src/python/osrf/cache.py",
221 "src/python/osrf/conf.py",
222 "src/python/osrf/const.py",
223 "src/python/osrf/ex.py",
224 "src/python/osrf/gateway.py",
225 "src/python/osrf/http_translator.py",
226 "src/python/osrf/json.py",
227 "src/python/osrf/log.py",
228 "src/python/osrf/net_obj.py",
229 "src/python/osrf/net.py",
230 "src/python/osrf/server.py",
231 "src/python/osrf/ses.py",
232 "src/python/osrf/set.py",
233 "src/python/osrf/stack.py",
234 "src/python/osrf/system.py",
235 "src/python/osrf/xml_obj.py",
236 "src/python/osrf/apps/example.py"]))
238 eg_factory = BuildFactory()
239 # check out the source
240 eg_factory.addStep(source.Git(
245 # bootstrap the code - old branches require autogen.sh
247 shell.ShellCommand(command=["./autogen.sh"],
248 doStepIf=eg_requires_autogen,
249 name="Bootstrap via autogen"
254 shell.ShellCommand(command=["autoreconf", "-f", "-i"],
255 doStepIf=eg_requires_autoreconf,
256 name="Bootstrap via autoreconf"
260 # configure (default args for now)
261 eg_factory.addStep(shell.Configure())
264 eg_factory.addStep(shell.Compile(command=["make"]))
266 perldir = 'build/Open-ILS/src/perlmods'
267 class PerlModuleTestMFHDMadness(shell.PerlModuleTest):
268 'Override PerlModuleTest with nonstandard library location for testlib.pm'
269 command = ['prove', '--lib', 'lib', '-I', 'lib/OpenILS/Utils/MFHD/test', '-r', 't']
272 # run the Perl unit tests
273 eg_factory.addStep(PerlModuleTestMFHDMadness(
274 doStepIf=has_perl_unit_tests,
278 # report on the Python code
279 eg_factory.addStep(python.PyLint(
280 env={"PYTHONPATH": ["Open-ILS/src/python"]},
281 flunkOnFailure=False,
283 "--output-format=parseable",
284 "Open-ILS/src/python/setup.py",
285 "Open-ILS/src/python/oils/const.py",
286 "Open-ILS/src/python/oils/event.py",
287 "Open-ILS/src/python/oils/__init__.py",
288 "Open-ILS/src/python/oils/org.py",
289 "Open-ILS/src/python/oils/srfsh.py",
290 "Open-ILS/src/python/oils/system.py",
291 "Open-ILS/src/python/oils/utils/csedit.py",
292 "Open-ILS/src/python/oils/utils/idl.py",
293 "Open-ILS/src/python/oils/utils/__init__.py",
294 "Open-ILS/src/python/oils/utils/utils.py"
298 from buildbot.config import BuilderConfig
302 for branch in OSRF_BRANCHES:
303 for distro, slave in OSRF_DISTROS:
304 build = "osrf-%s-%s" % (branch, distro)
305 c['builders'].append(BuilderConfig(name=build, slavenames=slave, factory=osrf_factory))
307 for branch in EG_BRANCHES:
308 for distro, slave in EG_DISTROS:
309 build = "evergreen-%s-%s" % (branch, distro)
310 c['builders'].append(BuilderConfig(name=build, slavenames=slave, factory=eg_factory))
312 ####### STATUS TARGETS
314 # 'status' is a list of Status Targets. The results of each build will be
315 # pushed to these targets. buildbot/status/*.py has a variety to choose from,
316 # including web pages, email senders, and IRC bots.
320 from buildbot.status import html
321 from buildbot.status.web import auth, authz
323 users = [('XXX', 'XXX'), ('XXX', 'XXX')]
324 authz_cfg = authz.Authz(
325 auth=auth.BasicAuth(users),
326 # change any of these to True to enable; see the manual for more
328 gracefulShutdown = False,
329 forceBuild = 'auth', # use this to test your slave once it is set up
330 forceAllBuilds = False,
333 stopAllBuilds = False,
334 cancelPendingBuild = False,
336 c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg))
338 # Send mail when a build is broken
339 from buildbot.status.mail import MailNotifier
341 fromaddr="buildbot@testing.evergreen-ils.org",
342 sendToInterestedUsers=True,
344 # , extraRecipients=["dan@coffeecode.net","open-ils-dev@list.georgialibraries.org"]
347 # Uncomment to actually send mail
348 c['status'].append(MN)
351 from buildbot.status import words
352 IRC = words.IRC("chat.freenode.net", "egbuilder",
353 channels=["#evergreen"],
358 'successToFailure': 1,
359 'failureToSuccess': 1,
361 c['status'].append(IRC)
363 ####### PROJECT IDENTITY
365 # the 'projectName' string will be used to describe the project that this
366 # buildbot is working on. For example, it is used as the title of the
367 # waterfall HTML page. The 'projectURL' string will be used to provide a link
368 # from buildbot HTML pages to your project's home page.
370 c['projectName'] = "Evergreen and OpenSRF"
371 c['projectURL'] = "http://evergreen-ils.org/"
373 # the 'buildbotURL' string should point to the location where the buildbot's
374 # internal web server (usually the html.WebStatus page) is visible. This
375 # typically uses the port number set in the Waterfall 'status' entry, but
376 # with an externally-visible host name which the buildbot cannot figure out
379 c['buildbotURL'] = "http://testing.evergreen-ils.org/buildbot/"
383 # This specifies what database buildbot uses to store change and scheduler
384 # state. You can leave this at its default for all but the largest
386 c['db_url'] = "sqlite:///state.sqlite"