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 class PerlModuleTestMFHDMadness(shell.PerlModuleTest):
191 'Override PerlModuleTest with nonstandard library location for testlib.pm'
192 command = ['prove', '--lib', 'lib', '-I', 'lib/OpenILS/Utils/MFHD/test', '-r', 't']
195 def has_perl_unit_tests(step):
196 if (os.path.exists(os.path.join('build/Open-ILS/src/perlmods', 'lib/OpenILS/Utils/MFHD/test'))):
200 # run the Perl unit tests
201 eg_factory.addStep(PerlModuleTestMFHDMadness(
202 doStepIf=has_perl_unit_tests,
203 workdir="build/Open-ILS/src/perlmods")
206 # report on the Python code
207 eg_factory.addStep(python.PyLint(
208 env={"PYTHONPATH": ["Open-ILS/src/python"]},
209 flunkOnFailure=False,
211 "--output-format=parseable",
212 "Open-ILS/src/python/setup.py",
213 "Open-ILS/src/python/oils/const.py",
214 "Open-ILS/src/python/oils/event.py",
215 "Open-ILS/src/python/oils/__init__.py",
216 "Open-ILS/src/python/oils/org.py",
217 "Open-ILS/src/python/oils/srfsh.py",
218 "Open-ILS/src/python/oils/system.py",
219 "Open-ILS/src/python/oils/utils/csedit.py",
220 "Open-ILS/src/python/oils/utils/idl.py",
221 "Open-ILS/src/python/oils/utils/__init__.py",
222 "Open-ILS/src/python/oils/utils/utils.py"
226 from buildbot.config import BuilderConfig
229 c['builders'].append(
230 BuilderConfig(name="osrf-trunk-ubuntu-10.04-x86_64",
231 slavenames=["opensrf-slave"],
232 factory=osrf_factory))
233 c['builders'].append(
234 BuilderConfig(name="osrf-rel_1_6-ubuntu-10.04-x86_64",
235 slavenames=["opensrf-slave"],
236 factory=osrf_factory))
237 c['builders'].append(
238 BuilderConfig(name="osrf-rel_2_0-ubuntu-10.04-x86_64",
239 slavenames=["opensrf-slave"],
240 factory=osrf_factory))
241 c['builders'].append(
242 BuilderConfig(name="evergreen-rel_1_6_1-debian-6.00-x86_64",
243 slavenames=["eg-slave"],
245 c['builders'].append(
246 BuilderConfig(name="evergreen-rel_2_0-debian-6.00-x86_64",
247 slavenames=["eg-slave"],
249 c['builders'].append(
250 BuilderConfig(name="evergreen-rel_2_1-debian-6.00-x86_64",
251 slavenames=["eg-slave"],
253 c['builders'].append(
254 BuilderConfig(name="evergreen-trunk-debian-6.00-x86_64",
255 slavenames=["eg-slave"],
258 ####### STATUS TARGETS
260 # 'status' is a list of Status Targets. The results of each build will be
261 # pushed to these targets. buildbot/status/*.py has a variety to choose from,
262 # including web pages, email senders, and IRC bots.
266 from buildbot.status import html
267 from buildbot.status.web import auth, authz
269 users = [('XXX', 'XXX'), ('XXX', 'XXX')]
270 authz_cfg=authz.Authz(
271 auth=auth.BasicAuth(users),
272 # change any of these to True to enable; see the manual for more
274 gracefulShutdown = False,
275 forceBuild = 'auth', # use this to test your slave once it is set up
276 forceAllBuilds = False,
279 stopAllBuilds = False,
280 cancelPendingBuild = False,
282 c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg))
284 # Send mail when a build is broken
285 from buildbot.status.mail import MailNotifier
287 fromaddr="buildbot@testing.esilibrary.com",
288 sendToInterestedUsers=False,
290 extraRecipients=["dan@coffeecode.net","open-ils-dev@list.georgialibraries.org"])
292 # Uncomment to actually send mail
293 # c['status'].append(mn)
295 ####### PROJECT IDENTITY
297 # the 'projectName' string will be used to describe the project that this
298 # buildbot is working on. For example, it is used as the title of the
299 # waterfall HTML page. The 'projectURL' string will be used to provide a link
300 # from buildbot HTML pages to your project's home page.
302 c['projectName'] = "Evergreen and OpenSRF"
303 c['projectURL'] = "http://evergreen-ils.org/"
305 # the 'buildbotURL' string should point to the location where the buildbot's
306 # internal web server (usually the html.WebStatus page) is visible. This
307 # typically uses the port number set in the Waterfall 'status' entry, but
308 # with an externally-visible host name which the buildbot cannot figure out
311 c['buildbotURL'] = "http://testing.evergreen-ils.org/buildbot/"
315 # This specifies what database buildbot uses to store change and scheduler
316 # state. You can leave this at its default for all but the largest
318 c['db_url'] = "sqlite:///state.sqlite"