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 = ('master', 'rel_1_6', 'rel_2_0')
31 osrf_distros = [('ubuntu-10.04-x86_64', 'opensrf-slave')]
32 eg_branches = ('master', '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
39 eg_git = 'git://git.evergreen-ils.org/Evergreen.git'
40 osrf_git = 'git://git.evergreen-ils.org/OpenSRF.git'
44 # the 'change_source' setting tells the buildmaster how it should find out
45 # about source code changes
47 from buildbot.changes import gitpoller
48 c['change_source'] = (
52 workdir='/tmp/buildbot_osrf_work'
57 workdir='/tmp/buildbot_eg_work'
62 from buildbot.schedulers.filter import ChangeFilter
63 master_filter = ChangeFilter(project='OpenSRF', branch="master")
64 rel_1_6_filter = ChangeFilter(project='OpenSRF', branch="rel_1_6")
65 rel_2_0_filter = ChangeFilter(project='OpenSRF', branch="rel_2_0")
66 eg_rel_1_6_1_filter = ChangeFilter(project='Evergreen', branch="rel_1_6_1")
67 eg_rel_2_0_filter = ChangeFilter(project='Evergreen', branch="rel_2_0")
68 eg_rel_2_1_filter = ChangeFilter(project='Evergreen', branch="rel_2_1")
69 eg_master_filter = ChangeFilter(project='Evergreen', branch="master")
73 # Configure the Schedulers, which decide how to react to incoming changes. In this
74 # case, just kick off a 'runtests' build
76 from buildbot.scheduler import Scheduler
78 c['schedulers'].append(Scheduler(name="osrf-master-full",
80 change_filter=master_filter,
81 builderNames=["osrf-master-ubuntu-10.04-x86_64"]))
83 c['schedulers'].append(Scheduler(name="osrf-rel_1_6",
85 change_filter=rel_1_6_filter,
86 builderNames=["osrf-rel_1_6-ubuntu-10.04-x86_64"]))
88 c['schedulers'].append(Scheduler(name="osrf-rel_2_0",
90 change_filter=rel_2_0_filter,
91 builderNames=["osrf-rel_2_0-ubuntu-10.04-x86_64"]))
93 c['schedulers'].append(Scheduler(name="evergreen-rel_1_6_1",
95 change_filter=eg_rel_1_6_1_filter,
97 "evergreen-rel_1_6_1-debian-6.00-x86_64",
98 "evergreen-rel_1_6_1-ubuntu-8.04-x86",
99 "evergreen-rel_1_6_1-ubuntu-10.04-x86"
102 c['schedulers'].append(Scheduler(name="evergreen-rel_2_0",
104 change_filter=eg_rel_2_0_filter,
106 "evergreen-rel_2_0-debian-6.00-x86_64",
107 "evergreen-rel_2_0-ubuntu-8.04-x86",
108 "evergreen-rel_2_0-ubuntu-10.04-x86"
111 c['schedulers'].append(Scheduler(name="evergreen-rel_2_1",
113 change_filter=eg_rel_2_1_filter,
115 "evergreen-rel_2_1-debian-6.00-x86_64",
116 "evergreen-rel_2_1-ubuntu-8.04-x86",
117 "evergreen-rel_2_1-ubuntu-10.04-x86"
120 c['schedulers'].append(Scheduler(name="evergreen-master",
122 change_filter=eg_master_filter,
124 "evergreen-master-debian-6.00-x86_64",
125 "evergreen-master-ubuntu-8.04-x86",
126 "evergreen-master-ubuntu-10.04-x86"
131 # The 'builders' list defines the Builders, which tell Buildbot how to perform a build:
132 # what steps, and which slaves can execute them. Note that any particular build will
133 # only take place on one slave.
135 from buildbot.process.factory import BuildFactory
136 from buildbot.steps import source
137 from buildbot.steps import shell
138 from buildbot.steps import python
139 from buildbot.steps import python_twisted
141 osrf_factory = BuildFactory()
142 # check out the source
143 osrf_factory.addStep(source.Git(
149 osrf_factory.addStep(shell.ShellCommand(command=["./autogen.sh"]))
151 # configure (default args for now)
152 osrf_factory.addStep(shell.Configure())
155 osrf_factory.addStep(shell.Compile(command=["make"]))
157 # run the Perl unit tests
158 osrf_factory.addStep(shell.PerlModuleTest(workdir="build/src/perl"))
160 # run the Python unit tests (available after rel_1_6)
161 def has_python_unit_test(step):
162 return step.build.getProperty('branch') != 'rel_1_6'
164 osrf_factory.addStep(python_twisted.Trial(
165 doStepIf=has_python_unit_test,
167 tests="src/python/tests/json_test.py"))
169 # report on the Python code
170 osrf_factory.addStep(python.PyLint(
171 env={"PYTHONPATH": ["src/python"]},
172 flunkOnFailure=False,
174 "--output-format=parseable",
175 "src/python/opensrf.py",
176 "src/python/osrf/app.py",
177 "src/python/osrf/cache.py",
178 "src/python/osrf/conf.py",
179 "src/python/osrf/const.py",
180 "src/python/osrf/ex.py",
181 "src/python/osrf/gateway.py",
182 "src/python/osrf/http_translator.py",
183 "src/python/osrf/json.py",
184 "src/python/osrf/log.py",
185 "src/python/osrf/net_obj.py",
186 "src/python/osrf/net.py",
187 "src/python/osrf/server.py",
188 "src/python/osrf/ses.py",
189 "src/python/osrf/set.py",
190 "src/python/osrf/stack.py",
191 "src/python/osrf/system.py",
192 "src/python/osrf/xml_obj.py",
193 "src/python/osrf/apps/example.py"]))
195 eg_factory = BuildFactory()
196 # check out the source
197 eg_factory.addStep(source.Git(
203 eg_factory.addStep(shell.ShellCommand(command=["./autogen.sh"]))
205 # configure (default args for now)
206 eg_factory.addStep(shell.Configure())
209 eg_factory.addStep(shell.Compile(command=["make"]))
211 perldir = 'build/Open-ILS/src/perlmods'
212 class PerlModuleTestMFHDMadness(shell.PerlModuleTest):
213 'Override PerlModuleTest with nonstandard library location for testlib.pm'
214 command = ['prove', '--lib', 'lib', '-I', 'lib/OpenILS/Utils/MFHD/test', '-r', 't']
217 def has_perl_unit_tests(step):
218 'Only run Perl tests if there are tests'
219 if (step.build.getProperty('branch') == 'rel_1_6_1'):
221 elif (step.build.getProperty('branch') == 'rel_2_0'):
225 # run the Perl unit tests
226 eg_factory.addStep(PerlModuleTestMFHDMadness(
227 doStepIf=has_perl_unit_tests,
231 # report on the Python code
232 eg_factory.addStep(python.PyLint(
233 env={"PYTHONPATH": ["Open-ILS/src/python"]},
234 flunkOnFailure=False,
236 "--output-format=parseable",
237 "Open-ILS/src/python/setup.py",
238 "Open-ILS/src/python/oils/const.py",
239 "Open-ILS/src/python/oils/event.py",
240 "Open-ILS/src/python/oils/__init__.py",
241 "Open-ILS/src/python/oils/org.py",
242 "Open-ILS/src/python/oils/srfsh.py",
243 "Open-ILS/src/python/oils/system.py",
244 "Open-ILS/src/python/oils/utils/csedit.py",
245 "Open-ILS/src/python/oils/utils/idl.py",
246 "Open-ILS/src/python/oils/utils/__init__.py",
247 "Open-ILS/src/python/oils/utils/utils.py"
251 from buildbot.config import BuilderConfig
255 for branch in osrf_branches:
256 for distro, slave in osrf_distros:
257 build = "osrf-%s-%s" % (branch, distro)
258 c['builders'].append(BuilderConfig(name=build, slavenames=slave, factory=osrf_factory))
260 for branch in eg_branches:
261 for distro, slave in eg_distros:
262 build = "evergreen-%s-%s" % (branch, distro)
263 c['builders'].append(BuilderConfig(name=build, slavenames=slave, factory=eg_factory))
265 ####### STATUS TARGETS
267 # 'status' is a list of Status Targets. The results of each build will be
268 # pushed to these targets. buildbot/status/*.py has a variety to choose from,
269 # including web pages, email senders, and IRC bots.
273 from buildbot.status import html
274 from buildbot.status.web import auth, authz
276 users = [('XXX', 'XXX'), ('XXX', 'XXX')]
277 authz_cfg = authz.Authz(
278 auth=auth.BasicAuth(users),
279 # change any of these to True to enable; see the manual for more
281 gracefulShutdown = False,
282 forceBuild = 'auth', # use this to test your slave once it is set up
283 forceAllBuilds = False,
286 stopAllBuilds = False,
287 cancelPendingBuild = False,
289 c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg))
291 # Send mail when a build is broken
292 from buildbot.status.mail import MailNotifier
294 fromaddr="buildbot@testing.esilibrary.com",
295 sendToInterestedUsers=False,
297 extraRecipients=["dan@coffeecode.net","open-ils-dev@list.georgialibraries.org"])
299 # Uncomment to actually send mail
300 # c['status'].append(mn)
302 ####### PROJECT IDENTITY
304 # the 'projectName' string will be used to describe the project that this
305 # buildbot is working on. For example, it is used as the title of the
306 # waterfall HTML page. The 'projectURL' string will be used to provide a link
307 # from buildbot HTML pages to your project's home page.
309 c['projectName'] = "Evergreen and OpenSRF"
310 c['projectURL'] = "http://evergreen-ils.org/"
312 # the 'buildbotURL' string should point to the location where the buildbot's
313 # internal web server (usually the html.WebStatus page) is visible. This
314 # typically uses the port number set in the Waterfall 'status' entry, but
315 # with an externally-visible host name which the buildbot cannot figure out
318 c['buildbotURL'] = "http://testing.evergreen-ils.org/buildbot/"
322 # This specifies what database buildbot uses to store change and scheduler
323 # state. You can leave this at its default for all but the largest
325 c['db_url'] = "sqlite:///state.sqlite"