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 = {}
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
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)
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
27 c['slavePortnum'] = XXX
29 # Branches and distros to build
30 osrf_branches = ('trunk', 'rel_1_6', 'rel_2_0')
31 osrf_distros = ({'ubuntu-10.04-x86_64': 'opensrf-slave'})
32 eg_branches = ('trunk', 'rel_1_6_1', 'rel_2_0', 'rel_2_1')
34 {'debian-6.00-x86_64': 'eg-slave'}, # UPEI
35 {'ubuntu-8.04-x86': 'eg-u804'}, # GPLS
36 {'ubuntu-10.04-x86': 'eg-u1004'} # GPLS
41 # the 'change_source' setting tells the buildmaster how it should find out
42 # about source code changes. Here we point to OpenSRF:
43 def split_file_branches_trunk(path):
44 pieces = path.split('/')
45 if pieces[0] == 'trunk':
46 return ('trunk', '/'.join(pieces[1:]))
47 elif pieces[0] == 'branches':
48 return ('/'.join(pieces[0:2]),
53 from buildbot.changes import svnpoller
54 c['change_source'] = (
57 svnurl='svn://svn.open-ils.org/OpenSRF',
58 split_file=svnpoller.split_file_branches,
62 svnurl='svn://svn.open-ils.org/ILS',
63 split_file=svnpoller.split_file_branches,
68 from buildbot.schedulers.filter import ChangeFilter
69 trunk_filter = ChangeFilter(project='OpenSRF', branch=None)
70 rel_1_6_filter = ChangeFilter(project='OpenSRF', branch="branches/rel_1_6")
71 rel_2_0_filter = ChangeFilter(project='OpenSRF', branch="branches/rel_2_0")
72 eg_rel_1_6_1_filter = ChangeFilter(project='Evergreen', branch="branches/rel_1_6_1")
73 eg_rel_2_0_filter = ChangeFilter(project='Evergreen', branch="branches/rel_2_0")
74 eg_rel_2_1_filter = ChangeFilter(project='Evergreen', branch="branches/rel_2_1")
75 eg_trunk_filter = ChangeFilter(project='Evergreen', branch=None)
79 # Configure the Schedulers, which decide how to react to incoming changes. In this
80 # case, just kick off a 'runtests' build
82 from buildbot.scheduler import Scheduler
84 c['schedulers'].append(Scheduler(name="osrf-trunk-full",
86 change_filter=trunk_filter,
87 builderNames=["osrf-trunk-ubuntu-10.04-x86_64"]))
89 c['schedulers'].append(Scheduler(name="osrf-rel_1_6",
91 change_filter=rel_1_6_filter,
92 builderNames=["osrf-rel_1_6-ubuntu-10.04-x86_64"]))
94 c['schedulers'].append(Scheduler(name="osrf-rel_2_0",
96 change_filter=rel_2_0_filter,
97 builderNames=["osrf-rel_2_0-ubuntu-10.04-x86_64"]))
99 c['schedulers'].append(Scheduler(name="evergreen-rel_1_6_1",
101 change_filter=eg_rel_1_6_1_filter,
103 "evergreen-rel_1_6_1-debian-6.00-x86_64",
104 "evergreen-rel_1_6_1-ubuntu-8.04-x86",
105 "evergreen-rel_1_6_1-ubuntu-10.04-x86"
108 c['schedulers'].append(Scheduler(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-8.04-x86",
114 "evergreen-rel_2_0-ubuntu-10.04-x86"
117 c['schedulers'].append(Scheduler(name="evergreen-rel_2_1",
119 change_filter=eg_rel_2_1_filter,
121 "evergreen-rel_2_1-debian-6.00-x86_64",
122 "evergreen-rel_2_1-ubuntu-8.04-x86",
123 "evergreen-rel_2_1-ubuntu-10.04-x86"
126 c['schedulers'].append(Scheduler(name="evergreen-trunk",
128 change_filter=eg_trunk_filter,
130 "evergreen-trunk-debian-6.00-x86_64",
131 "evergreen-trunk-ubuntu-8.04-x86",
132 "evergreen-trunk-ubuntu-10.04-x86"
137 # The 'builders' list defines the Builders, which tell Buildbot how to perform a build:
138 # what steps, and which slaves can execute them. Note that any particular build will
139 # only take place on one slave.
141 from buildbot.process.factory import BuildFactory
142 from buildbot.steps import source
143 from buildbot.steps import shell
144 from buildbot.steps import python
145 from buildbot.steps import python_twisted
147 osrf_factory = BuildFactory()
148 # check out the source
149 osrf_factory.addStep(source.SVN(
150 baseURL='svn://svn.open-ils.org/OpenSRF/',
151 defaultBranch='trunk',
155 osrf_factory.addStep(shell.ShellCommand(command=["./autogen.sh"]))
157 # configure (default args for now)
158 osrf_factory.addStep(shell.Configure())
161 osrf_factory.addStep(shell.Compile(command=["make"]))
163 # run the Perl unit tests
164 osrf_factory.addStep(shell.PerlModuleTest(workdir="build/src/perl"))
166 # run the Python unit tests (available after rel_1_6)
167 def has_python_unit_test(step):
168 return step.build.getProperty('branch') != 'branches/rel_1_6'
170 osrf_factory.addStep(python_twisted.Trial(
171 doStepIf=has_python_unit_test,
173 tests="src/python/tests/json_test.py"))
175 # report on the Python code
176 osrf_factory.addStep(python.PyLint(
177 env={"PYTHONPATH": ["src/python"]},
178 flunkOnFailure=False,
180 "--output-format=parseable",
181 "src/python/opensrf.py",
182 "src/python/osrf/app.py",
183 "src/python/osrf/cache.py",
184 "src/python/osrf/conf.py",
185 "src/python/osrf/const.py",
186 "src/python/osrf/ex.py",
187 "src/python/osrf/gateway.py",
188 "src/python/osrf/http_translator.py",
189 "src/python/osrf/json.py",
190 "src/python/osrf/log.py",
191 "src/python/osrf/net_obj.py",
192 "src/python/osrf/net.py",
193 "src/python/osrf/server.py",
194 "src/python/osrf/ses.py",
195 "src/python/osrf/set.py",
196 "src/python/osrf/stack.py",
197 "src/python/osrf/system.py",
198 "src/python/osrf/xml_obj.py",
199 "src/python/osrf/apps/example.py"]))
201 eg_factory = BuildFactory()
202 # check out the source
203 eg_factory.addStep(source.SVN(
204 baseURL='svn://svn.open-ils.org/ILS/',
205 defaultBranch='trunk',
209 eg_factory.addStep(shell.ShellCommand(command=["./autogen.sh"]))
211 # configure (default args for now)
212 eg_factory.addStep(shell.Configure())
215 eg_factory.addStep(shell.Compile(command=["make"]))
217 perldir = 'build/Open-ILS/src/perlmods'
218 class PerlModuleTestMFHDMadness(shell.PerlModuleTest):
219 'Override PerlModuleTest with nonstandard library location for testlib.pm'
220 command = ['prove', '--lib', 'lib', '-I', 'lib/OpenILS/Utils/MFHD/test', '-r', 't']
223 def has_perl_unit_tests(step):
224 'Only run Perl tests if there are tests'
225 if (step.build.getProperty('branch') == 'branches/rel_1_6_1'):
227 elif (step.build.getProperty('branch') == 'branches/rel_2_0'):
231 # run the Perl unit tests
232 eg_factory.addStep(PerlModuleTestMFHDMadness(
233 doStepIf=has_perl_unit_tests,
237 # report on the Python code
238 eg_factory.addStep(python.PyLint(
239 env={"PYTHONPATH": ["Open-ILS/src/python"]},
240 flunkOnFailure=False,
242 "--output-format=parseable",
243 "Open-ILS/src/python/setup.py",
244 "Open-ILS/src/python/oils/const.py",
245 "Open-ILS/src/python/oils/event.py",
246 "Open-ILS/src/python/oils/__init__.py",
247 "Open-ILS/src/python/oils/org.py",
248 "Open-ILS/src/python/oils/srfsh.py",
249 "Open-ILS/src/python/oils/system.py",
250 "Open-ILS/src/python/oils/utils/csedit.py",
251 "Open-ILS/src/python/oils/utils/idl.py",
252 "Open-ILS/src/python/oils/utils/__init__.py",
253 "Open-ILS/src/python/oils/utils/utils.py"
257 from buildbot.config import BuilderConfig
261 for branch in osrf_branches:
262 for distro, slave in osrf_distros:
263 build = "osrf-%s-%s" % (branch, distro)
264 c['builders'].append(name=build, slavenames=slave, factory=osrf_factory)
266 for branch in eg_branches:
267 for distro, slave in eg_distros:
268 build = "evergreen-%s-%s" % (branch, distro)
269 c['builders'].append(name=build, slavenames=slave, factory=eg_factory)
271 ####### STATUS TARGETS
273 # 'status' is a list of Status Targets. The results of each build will be
274 # pushed to these targets. buildbot/status/*.py has a variety to choose from,
275 # including web pages, email senders, and IRC bots.
279 from buildbot.status import html
280 from buildbot.status.web import auth, authz
282 users = [('XXX', 'XXX'), ('XXX', 'XXX')]
283 authz_cfg = authz.Authz(
284 auth=auth.BasicAuth(users),
285 # change any of these to True to enable; see the manual for more
287 gracefulShutdown = False,
288 forceBuild = 'auth', # use this to test your slave once it is set up
289 forceAllBuilds = False,
292 stopAllBuilds = False,
293 cancelPendingBuild = False,
295 c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg))
297 # Send mail when a build is broken
298 from buildbot.status.mail import MailNotifier
300 fromaddr="buildbot@testing.esilibrary.com",
301 sendToInterestedUsers=False,
303 extraRecipients=["dan@coffeecode.net","open-ils-dev@list.georgialibraries.org"])
305 # Uncomment to actually send mail
306 # c['status'].append(mn)
308 ####### PROJECT IDENTITY
310 # the 'projectName' string will be used to describe the project that this
311 # buildbot is working on. For example, it is used as the title of the
312 # waterfall HTML page. The 'projectURL' string will be used to provide a link
313 # from buildbot HTML pages to your project's home page.
315 c['projectName'] = "Evergreen and OpenSRF"
316 c['projectURL'] = "http://evergreen-ils.org/"
318 # the 'buildbotURL' string should point to the location where the buildbot's
319 # internal web server (usually the html.WebStatus page) is visible. This
320 # typically uses the port number set in the Waterfall 'status' entry, but
321 # with an externally-visible host name which the buildbot cannot figure out
324 c['buildbotURL'] = "http://testing.evergreen-ils.org/buildbot/"
328 # This specifies what database buildbot uses to store change and scheduler
329 # state. You can leave this at its default for all but the largest
331 c['db_url'] = "sqlite:///state.sqlite"