2 # vim: set syntax=python:et:ts=4:sw=4:
5 # This is a sample buildmaster config file. It must be installed as
6 # 'master.cfg' in your buildmaster's base directory.
8 # This is the dictionary that the buildmaster pays attention to. We also use
9 # a shorter alias to save typing.
10 c = BuildmasterConfig = {}
14 # The 'slaves' list defines the set of recognized buildslaves. Each element is
15 # a BuildSlave object, specifying a username and password. The same username and
16 # password must be configured on the slave.
17 from buildbot.buildslave import BuildSlave
19 BuildSlave("opensrf-slave", "XXX", max_builds=1),
20 BuildSlave("eg-slave", "XXX", max_builds=1)
23 # 'slavePortnum' defines the TCP port to listen on for connections from slaves.
24 # This must match the value configured into the buildslaves (with their
26 c['slavePortnum'] = XXX
30 # the 'change_source' setting tells the buildmaster how it should find out
31 # about source code changes. Here we point to OpenSRF:
32 def split_file_branches_trunk(path):
33 pieces = path.split('/')
34 if pieces[0] == 'trunk':
35 return ('trunk', '/'.join(pieces[1:]))
36 elif pieces[0] == 'branches':
37 return ('/'.join(pieces[0:2]),
42 from buildbot.changes import svnpoller
43 c['change_source'] = (
46 svnurl='svn://svn.open-ils.org/OpenSRF',
47 split_file=svnpoller.split_file_branches,
51 svnurl='svn://svn.open-ils.org/ILS',
52 split_file=svnpoller.split_file_branches,
57 from buildbot.schedulers.filter import ChangeFilter
58 trunk_filter = ChangeFilter(project='OpenSRF', branch=None)
59 rel_1_6_filter = ChangeFilter(project='OpenSRF', branch="branches/rel_1_6")
60 rel_2_0_filter = ChangeFilter(project='OpenSRF', branch="branches/rel_2_0")
61 eg_rel_1_6_1_filter = ChangeFilter(project='Evergreen', branch="branches/rel_1_6_1")
62 eg_rel_2_0_filter = ChangeFilter(project='Evergreen', branch="branches/rel_2_0")
63 eg_rel_2_1_filter = ChangeFilter(project='Evergreen', branch="branches/rel_2_1")
64 eg_trunk_filter = ChangeFilter(project='Evergreen', branch=None)
68 # Configure the Schedulers, which decide how to react to incoming changes. In this
69 # case, just kick off a 'runtests' build
71 from buildbot.scheduler import Scheduler
73 c['schedulers'].append(Scheduler(name="osrf-trunk-full",
75 change_filter=trunk_filter,
76 builderNames=["osrf-trunk-ubuntu-10.04-x86_64"]))
78 c['schedulers'].append(Scheduler(name="osrf-rel_1_6",
80 change_filter=rel_1_6_filter,
81 builderNames=["osrf-rel_1_6-ubuntu-10.04-x86_64"]))
83 c['schedulers'].append(Scheduler(name="osrf-rel_2_0",
85 change_filter=rel_2_0_filter,
86 builderNames=["osrf-rel_2_0-ubuntu-10.04-x86_64"]))
88 c['schedulers'].append(Scheduler(name="evergreen-rel_1_6_1",
90 change_filter=eg_rel_1_6_1_filter,
91 builderNames=["evergreen-rel_1_6_1-debian-6.00-x86_64"]))
93 c['schedulers'].append(Scheduler(name="evergreen-rel_2_0",
95 change_filter=eg_rel_2_0_filter,
96 builderNames=["evergreen-rel_2_0-debian-6.00-x86_64"]))
98 c['schedulers'].append(Scheduler(name="evergreen-rel_2_1",
100 change_filter=eg_rel_2_1_filter,
101 builderNames=["evergreen-rel_2_1-debian-6.00-x86_64"]))
103 c['schedulers'].append(Scheduler(name="evergreen-trunk",
105 change_filter=eg_trunk_filter,
106 builderNames=["evergreen-trunk-debian-6.00-x86_64"]))
110 # The 'builders' list defines the Builders, which tell Buildbot how to perform a build:
111 # what steps, and which slaves can execute them. Note that any particular build will
112 # only take place on one slave.
114 from buildbot.process.factory import BuildFactory
115 from buildbot.steps import source
116 from buildbot.steps import shell
117 from buildbot.steps import python
118 from buildbot.steps import python_twisted
120 osrf_factory = BuildFactory()
121 # check out the source
122 osrf_factory.addStep(source.SVN(
123 baseURL='svn://svn.open-ils.org/OpenSRF/',
124 defaultBranch='trunk',
128 osrf_factory.addStep(shell.ShellCommand(command=["./autogen.sh"]))
130 # configure (default args for now)
131 osrf_factory.addStep(shell.Configure())
134 osrf_factory.addStep(shell.Compile(command=["make"]))
136 # run the Perl unit tests
137 osrf_factory.addStep(shell.PerlModuleTest(workdir="build/src/perl"))
139 # run the Python unit tests (available after rel_1_6)
140 def has_python_unit_test(step):
141 return step.build.getProperty('branch') != 'branches/rel_1_6'
143 osrf_factory.addStep(python_twisted.Trial(
144 doStepIf=has_python_unit_test,
146 tests="src/python/tests/json_test.py"))
148 # report on the Python code
149 osrf_factory.addStep(python.PyLint(
150 env={"PYTHONPATH": ["src/python"]},
151 flunkOnFailure=False,
153 "--output-format=parseable",
154 "src/python/opensrf.py",
155 "src/python/osrf/app.py",
156 "src/python/osrf/cache.py",
157 "src/python/osrf/conf.py",
158 "src/python/osrf/const.py",
159 "src/python/osrf/ex.py",
160 "src/python/osrf/gateway.py",
161 "src/python/osrf/http_translator.py",
162 "src/python/osrf/json.py",
163 "src/python/osrf/log.py",
164 "src/python/osrf/net_obj.py",
165 "src/python/osrf/net.py",
166 "src/python/osrf/server.py",
167 "src/python/osrf/ses.py",
168 "src/python/osrf/set.py",
169 "src/python/osrf/stack.py",
170 "src/python/osrf/system.py",
171 "src/python/osrf/xml_obj.py",
172 "src/python/osrf/apps/example.py"]))
174 eg_factory = BuildFactory()
175 # check out the source
176 eg_factory.addStep(source.SVN(
177 baseURL='svn://svn.open-ils.org/ILS/',
178 defaultBranch='trunk',
182 eg_factory.addStep(shell.ShellCommand(command=["./autogen.sh"]))
184 # configure (default args for now)
185 eg_factory.addStep(shell.Configure())
188 eg_factory.addStep(shell.Compile(command=["make"]))
190 perldir = 'build/Open-ILS/src/perlmods'
191 class PerlModuleTestMFHDMadness(shell.PerlModuleTest):
192 'Override PerlModuleTest with nonstandard library location for testlib.pm'
193 command = ['prove', '--lib', 'lib', '-I', 'lib/OpenILS/Utils/MFHD/test', '-r', 't']
196 def has_perl_unit_tests(step):
197 'If there is a /lib/ sudir in the Perl dir, there are tests'
198 if (os.path.exists(os.path.join(perldir, 'lib'))):
202 # run the Perl unit tests
203 eg_factory.addStep(PerlModuleTestMFHDMadness(
204 doStepIf=has_perl_unit_tests,
208 # report on the Python code
209 eg_factory.addStep(python.PyLint(
210 env={"PYTHONPATH": ["Open-ILS/src/python"]},
211 flunkOnFailure=False,
213 "--output-format=parseable",
214 "Open-ILS/src/python/setup.py",
215 "Open-ILS/src/python/oils/const.py",
216 "Open-ILS/src/python/oils/event.py",
217 "Open-ILS/src/python/oils/__init__.py",
218 "Open-ILS/src/python/oils/org.py",
219 "Open-ILS/src/python/oils/srfsh.py",
220 "Open-ILS/src/python/oils/system.py",
221 "Open-ILS/src/python/oils/utils/csedit.py",
222 "Open-ILS/src/python/oils/utils/idl.py",
223 "Open-ILS/src/python/oils/utils/__init__.py",
224 "Open-ILS/src/python/oils/utils/utils.py"
228 from buildbot.config import BuilderConfig
231 c['builders'].append(
232 BuilderConfig(name="osrf-trunk-ubuntu-10.04-x86_64",
233 slavenames=["opensrf-slave"],
234 factory=osrf_factory))
235 c['builders'].append(
236 BuilderConfig(name="osrf-rel_1_6-ubuntu-10.04-x86_64",
237 slavenames=["opensrf-slave"],
238 factory=osrf_factory))
239 c['builders'].append(
240 BuilderConfig(name="osrf-rel_2_0-ubuntu-10.04-x86_64",
241 slavenames=["opensrf-slave"],
242 factory=osrf_factory))
243 c['builders'].append(
244 BuilderConfig(name="evergreen-rel_1_6_1-debian-6.00-x86_64",
245 slavenames=["eg-slave"],
247 c['builders'].append(
248 BuilderConfig(name="evergreen-rel_2_0-debian-6.00-x86_64",
249 slavenames=["eg-slave"],
251 c['builders'].append(
252 BuilderConfig(name="evergreen-rel_2_1-debian-6.00-x86_64",
253 slavenames=["eg-slave"],
255 c['builders'].append(
256 BuilderConfig(name="evergreen-trunk-debian-6.00-x86_64",
257 slavenames=["eg-slave"],
260 ####### STATUS TARGETS
262 # 'status' is a list of Status Targets. The results of each build will be
263 # pushed to these targets. buildbot/status/*.py has a variety to choose from,
264 # including web pages, email senders, and IRC bots.
268 from buildbot.status import html
269 from buildbot.status.web import auth, authz
271 users = [('XXX', 'XXX'), ('XXX', 'XXX')]
272 authz_cfg=authz.Authz(
273 auth=auth.BasicAuth(users),
274 # change any of these to True to enable; see the manual for more
276 gracefulShutdown = False,
277 forceBuild = 'auth', # use this to test your slave once it is set up
278 forceAllBuilds = False,
281 stopAllBuilds = False,
282 cancelPendingBuild = False,
284 c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg))
286 # Send mail when a build is broken
287 from buildbot.status.mail import MailNotifier
289 fromaddr="buildbot@testing.esilibrary.com",
290 sendToInterestedUsers=False,
292 extraRecipients=["dan@coffeecode.net","open-ils-dev@list.georgialibraries.org"])
294 # Uncomment to actually send mail
295 # c['status'].append(mn)
297 ####### PROJECT IDENTITY
299 # the 'projectName' string will be used to describe the project that this
300 # buildbot is working on. For example, it is used as the title of the
301 # waterfall HTML page. The 'projectURL' string will be used to provide a link
302 # from buildbot HTML pages to your project's home page.
304 c['projectName'] = "Evergreen and OpenSRF"
305 c['projectURL'] = "http://evergreen-ils.org/"
307 # the 'buildbotURL' string should point to the location where the buildbot's
308 # internal web server (usually the html.WebStatus page) is visible. This
309 # typically uses the port number set in the Waterfall 'status' entry, but
310 # with an externally-visible host name which the buildbot cannot figure out
313 c['buildbotURL'] = "http://testing.evergreen-ils.org/buildbot/"
317 # This specifies what database buildbot uses to store change and scheduler
318 # state. You can leave this at its default for all but the largest
320 c['db_url'] = "sqlite:///state.sqlite"