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)
22 # 'slavePortnum' defines the TCP port to listen on for connections from slaves.
23 # This must match the value configured into the buildslaves (with their
25 c['slavePortnum'] = XXX
29 # the 'change_source' setting tells the buildmaster how it should find out
30 # about source code changes. Here we point to OpenSRF:
31 def split_file_branches_trunk(path):
32 pieces = path.split('/')
33 if pieces[0] == 'trunk':
34 return ('trunk', '/'.join(pieces[1:]))
35 elif pieces[0] == 'branches':
36 return ('/'.join(pieces[0:2]),
41 from buildbot.changes import svnpoller
42 c['change_source'] = (
45 svnurl='svn://svn.open-ils.org/OpenSRF',
46 split_file=svnpoller.split_file_branches,
50 svnurl='svn://svn.open-ils.org/ILS',
51 split_file=svnpoller.split_file_branches,
56 from buildbot.schedulers.filter import ChangeFilter
57 trunk_filter = ChangeFilter(project='OpenSRF', branch=None)
58 rel_1_6_filter = ChangeFilter(project='OpenSRF', branch="branches/rel_1_6")
59 rel_2_0_filter = ChangeFilter(project='OpenSRF', branch="branches/rel_2_0")
60 eg_rel_1_6_1_filter = ChangeFilter(project='Evergreen', branch="branches/rel_1_6_1")
61 eg_rel_2_0_filter = ChangeFilter(project='Evergreen', branch="branches/rel_2_0")
62 eg_rel_2_1_filter = ChangeFilter(project='Evergreen', branch="branches/rel_2_1")
63 eg_trunk_filter = ChangeFilter(project='Evergreen', branch=None)
67 # Configure the Schedulers, which decide how to react to incoming changes. In this
68 # case, just kick off a 'runtests' build
70 from buildbot.scheduler import Scheduler
72 c['schedulers'].append(Scheduler(name="osrf-trunk-full",
74 change_filter=trunk_filter,
75 builderNames=["osrf-trunk-ubuntu-10.04-x86_64"]))
77 c['schedulers'].append(Scheduler(name="osrf-rel_1_6",
79 change_filter=rel_1_6_filter,
80 builderNames=["osrf-rel_1_6-ubuntu-10.04-x86_64"]))
82 c['schedulers'].append(Scheduler(name="osrf-rel_2_0",
84 change_filter=rel_2_0_filter,
85 builderNames=["osrf-rel_2_0-ubuntu-10.04-x86_64"]))
87 c['schedulers'].append(Scheduler(name="evergreen-rel_1_6_1",
89 change_filter=eg_rel_1_6_1_filter,
91 "evergreen-rel_1_6_1-debian-6.00-x86_64",
92 "evergreen-rel_1_6_1-ubuntu-8.04-x86",
93 "evergreen-rel_1_6_1-ubuntu-10.04-x86"
96 c['schedulers'].append(Scheduler(name="evergreen-rel_2_0",
98 change_filter=eg_rel_2_0_filter,
100 "evergreen-rel_2_0-debian-6.00-x86_64",
101 "evergreen-rel_2_0-ubuntu-8.04-x86",
102 "evergreen-rel_2_0-ubuntu-10.04-x86"
105 c['schedulers'].append(Scheduler(name="evergreen-rel_2_1",
107 change_filter=eg_rel_2_1_filter,
109 "evergreen-rel_2_1-debian-6.00-x86_64",
110 "evergreen-rel_2_1-ubuntu-8.04-x86",
111 "evergreen-rel_2_1-ubuntu-10.04-x86"
114 c['schedulers'].append(Scheduler(name="evergreen-trunk",
116 change_filter=eg_trunk_filter,
118 "evergreen-trunk-debian-6.00-x86_64",
119 "evergreen-trunk-ubuntu-8.04-x86",
120 "evergreen-trunk-ubuntu-10.04-x86"
125 # The 'builders' list defines the Builders, which tell Buildbot how to perform a build:
126 # what steps, and which slaves can execute them. Note that any particular build will
127 # only take place on one slave.
129 from buildbot.process.factory import BuildFactory
130 from buildbot.steps import source
131 from buildbot.steps import shell
132 from buildbot.steps import python
133 from buildbot.steps import python_twisted
135 osrf_factory = BuildFactory()
136 # check out the source
137 osrf_factory.addStep(source.SVN(
138 baseURL='svn://svn.open-ils.org/OpenSRF/',
139 defaultBranch='trunk',
143 osrf_factory.addStep(shell.ShellCommand(command=["./autogen.sh"]))
145 # configure (default args for now)
146 osrf_factory.addStep(shell.Configure())
149 osrf_factory.addStep(shell.Compile(command=["make"]))
151 # run the Perl unit tests
152 osrf_factory.addStep(shell.PerlModuleTest(workdir="build/src/perl"))
154 # run the Python unit tests (available after rel_1_6)
155 def has_python_unit_test(step):
156 return step.build.getProperty('branch') != 'branches/rel_1_6'
158 osrf_factory.addStep(python_twisted.Trial(
159 doStepIf=has_python_unit_test,
161 tests="src/python/tests/json_test.py"))
163 # report on the Python code
164 osrf_factory.addStep(python.PyLint(
165 env={"PYTHONPATH": ["src/python"]},
166 flunkOnFailure=False,
168 "--output-format=parseable",
169 "src/python/opensrf.py",
170 "src/python/osrf/app.py",
171 "src/python/osrf/cache.py",
172 "src/python/osrf/conf.py",
173 "src/python/osrf/const.py",
174 "src/python/osrf/ex.py",
175 "src/python/osrf/gateway.py",
176 "src/python/osrf/http_translator.py",
177 "src/python/osrf/json.py",
178 "src/python/osrf/log.py",
179 "src/python/osrf/net_obj.py",
180 "src/python/osrf/net.py",
181 "src/python/osrf/server.py",
182 "src/python/osrf/ses.py",
183 "src/python/osrf/set.py",
184 "src/python/osrf/stack.py",
185 "src/python/osrf/system.py",
186 "src/python/osrf/xml_obj.py",
187 "src/python/osrf/apps/example.py"]))
189 eg_factory = BuildFactory()
190 # check out the source
191 eg_factory.addStep(source.SVN(
192 baseURL='svn://svn.open-ils.org/ILS/',
193 defaultBranch='trunk',
197 eg_factory.addStep(shell.ShellCommand(command=["./autogen.sh"]))
199 # configure (default args for now)
200 eg_factory.addStep(shell.Configure())
203 eg_factory.addStep(shell.Compile(command=["make"]))
205 perldir = 'build/Open-ILS/src/perlmods'
206 class PerlModuleTestMFHDMadness(shell.PerlModuleTest):
207 'Override PerlModuleTest with nonstandard library location for testlib.pm'
208 command = ['prove', '--lib', 'lib', '-I', 'lib/OpenILS/Utils/MFHD/test', '-r', 't']
211 def has_perl_unit_tests(step):
212 'Only run Perl tests if there are tests'
213 if (step.build.getProperty('branch') == 'branches/rel_1_6_1'):
215 elif (step.build.getProperty('branch') == 'branches/rel_2_0'):
219 # run the Perl unit tests
220 eg_factory.addStep(PerlModuleTestMFHDMadness(
221 doStepIf=has_perl_unit_tests,
225 # report on the Python code
226 eg_factory.addStep(python.PyLint(
227 env={"PYTHONPATH": ["Open-ILS/src/python"]},
228 flunkOnFailure=False,
230 "--output-format=parseable",
231 "Open-ILS/src/python/setup.py",
232 "Open-ILS/src/python/oils/const.py",
233 "Open-ILS/src/python/oils/event.py",
234 "Open-ILS/src/python/oils/__init__.py",
235 "Open-ILS/src/python/oils/org.py",
236 "Open-ILS/src/python/oils/srfsh.py",
237 "Open-ILS/src/python/oils/system.py",
238 "Open-ILS/src/python/oils/utils/csedit.py",
239 "Open-ILS/src/python/oils/utils/idl.py",
240 "Open-ILS/src/python/oils/utils/__init__.py",
241 "Open-ILS/src/python/oils/utils/utils.py"
245 from buildbot.config import BuilderConfig
248 c['builders'].append(
249 BuilderConfig(name="osrf-trunk-ubuntu-10.04-x86_64",
250 slavenames=["opensrf-slave"],
251 factory=osrf_factory))
252 c['builders'].append(
253 BuilderConfig(name="osrf-rel_1_6-ubuntu-10.04-x86_64",
254 slavenames=["opensrf-slave"],
255 factory=osrf_factory))
256 c['builders'].append(
257 BuilderConfig(name="osrf-rel_2_0-ubuntu-10.04-x86_64",
258 slavenames=["opensrf-slave"],
259 factory=osrf_factory))
260 c['builders'].append(
261 BuilderConfig(name="evergreen-rel_1_6_1-debian-6.00-x86_64",
262 slavenames=["eg-slave"],
264 c['builders'].append(
265 BuilderConfig(name="evergreen-rel_2_0-debian-6.00-x86_64",
266 slavenames=["eg-slave"],
268 c['builders'].append(
269 BuilderConfig(name="evergreen-rel_2_1-debian-6.00-x86_64",
270 slavenames=["eg-slave"],
272 c['builders'].append(
273 BuilderConfig(name="evergreen-trunk-debian-6.00-x86_64",
274 slavenames=["eg-slave"],
277 ####### STATUS TARGETS
279 # 'status' is a list of Status Targets. The results of each build will be
280 # pushed to these targets. buildbot/status/*.py has a variety to choose from,
281 # including web pages, email senders, and IRC bots.
285 from buildbot.status import html
286 from buildbot.status.web import auth, authz
288 users = [('XXX', 'XXX'), ('XXX', 'XXX')]
289 authz_cfg=authz.Authz(
290 auth=auth.BasicAuth(users),
291 # change any of these to True to enable; see the manual for more
293 gracefulShutdown = False,
294 forceBuild = 'auth', # use this to test your slave once it is set up
295 forceAllBuilds = False,
298 stopAllBuilds = False,
299 cancelPendingBuild = False,
301 c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg))
303 # Send mail when a build is broken
304 from buildbot.status.mail import MailNotifier
306 fromaddr="buildbot@testing.esilibrary.com",
307 sendToInterestedUsers=False,
309 extraRecipients=["dan@coffeecode.net","open-ils-dev@list.georgialibraries.org"])
311 # Uncomment to actually send mail
312 # c['status'].append(mn)
314 ####### PROJECT IDENTITY
316 # the 'projectName' string will be used to describe the project that this
317 # buildbot is working on. For example, it is used as the title of the
318 # waterfall HTML page. The 'projectURL' string will be used to provide a link
319 # from buildbot HTML pages to your project's home page.
321 c['projectName'] = "Evergreen and OpenSRF"
322 c['projectURL'] = "http://evergreen-ils.org/"
324 # the 'buildbotURL' string should point to the location where the buildbot's
325 # internal web server (usually the html.WebStatus page) is visible. This
326 # typically uses the port number set in the Waterfall 'status' entry, but
327 # with an externally-visible host name which the buildbot cannot figure out
330 c['buildbotURL'] = "http://testing.evergreen-ils.org/buildbot/"
334 # This specifies what database buildbot uses to store change and scheduler
335 # state. You can leave this at its default for all but the largest
337 c['db_url'] = "sqlite:///state.sqlite"