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'] = []
49 for osrf_branch in OSRF_BRANCHES:
50 c['change_source'].append(gitpoller.GitPoller(
53 workdir='/tmp/buildbot_osrf_' + osrf_branch,
57 for eg_branch in EG_BRANCHES:
58 c['change_source'].append(gitpoller.GitPoller(
61 workdir='/tmp/buildbot_eg_' + eg_branch,
66 from buildbot.schedulers.filter import ChangeFilter
67 master_filter = ChangeFilter(project='OpenSRF', branch="master")
68 rel_1_6_filter = ChangeFilter(project='OpenSRF', branch="rel_1_6")
69 rel_2_0_filter = ChangeFilter(project='OpenSRF', branch="rel_2_0")
70 eg_rel_1_6_1_filter = ChangeFilter(project='Evergreen', branch="rel_1_6_1")
71 eg_rel_2_0_filter = ChangeFilter(project='Evergreen', branch="rel_2_0")
72 eg_rel_2_1_filter = ChangeFilter(project='Evergreen', branch="rel_2_1")
73 eg_master_filter = ChangeFilter(project='Evergreen', branch="master")
77 # Configure the Schedulers, which decide how to react to incoming changes. In this
78 # case, just kick off a 'runtests' build
80 from buildbot.scheduler import Scheduler
82 c['schedulers'].append(Scheduler(name="osrf-master-full",
84 change_filter=master_filter,
85 builderNames=["osrf-master-ubuntu-10.04-x86_64"]))
87 c['schedulers'].append(Scheduler(name="osrf-rel_1_6",
89 change_filter=rel_1_6_filter,
90 builderNames=["osrf-rel_1_6-ubuntu-10.04-x86_64"]))
92 c['schedulers'].append(Scheduler(name="osrf-rel_2_0",
94 change_filter=rel_2_0_filter,
95 builderNames=["osrf-rel_2_0-ubuntu-10.04-x86_64"]))
97 c['schedulers'].append(Scheduler(name="evergreen-rel_1_6_1",
99 change_filter=eg_rel_1_6_1_filter,
101 "evergreen-rel_1_6_1-debian-6.00-x86_64",
102 "evergreen-rel_1_6_1-ubuntu-8.04-x86",
103 "evergreen-rel_1_6_1-ubuntu-10.04-x86"
106 c['schedulers'].append(Scheduler(name="evergreen-rel_2_0",
108 change_filter=eg_rel_2_0_filter,
110 "evergreen-rel_2_0-debian-6.00-x86_64",
111 "evergreen-rel_2_0-ubuntu-8.04-x86",
112 "evergreen-rel_2_0-ubuntu-10.04-x86"
115 c['schedulers'].append(Scheduler(name="evergreen-rel_2_1",
117 change_filter=eg_rel_2_1_filter,
119 "evergreen-rel_2_1-debian-6.00-x86_64",
120 "evergreen-rel_2_1-ubuntu-8.04-x86",
121 "evergreen-rel_2_1-ubuntu-10.04-x86"
124 c['schedulers'].append(Scheduler(name="evergreen-master",
126 change_filter=eg_master_filter,
128 "evergreen-master-debian-6.00-x86_64",
129 "evergreen-master-ubuntu-8.04-x86",
130 "evergreen-master-ubuntu-10.04-x86"
135 # The 'builders' list defines the Builders, which tell Buildbot how to perform a build:
136 # what steps, and which slaves can execute them. Note that any particular build will
137 # only take place on one slave.
139 from buildbot.process.factory import BuildFactory
140 from buildbot.steps import source
141 from buildbot.steps import shell
142 from buildbot.steps import python
143 from buildbot.steps import python_twisted
145 osrf_factory = BuildFactory()
146 # check out the source
147 osrf_factory.addStep(source.Git(
153 osrf_factory.addStep(shell.ShellCommand(command=["./autogen.sh"]))
155 # configure (default args for now)
156 osrf_factory.addStep(shell.Configure())
159 osrf_factory.addStep(shell.Compile(command=["make"]))
161 # run the Perl unit tests
162 osrf_factory.addStep(shell.PerlModuleTest(workdir="build/src/perl"))
164 # run the Python unit tests (available after rel_1_6)
165 def has_python_unit_test(step):
166 return step.build.getProperty('branch') != 'rel_1_6'
168 osrf_factory.addStep(python_twisted.Trial(
169 doStepIf=has_python_unit_test,
171 tests="src/python/tests/json_test.py"))
173 # report on the Python code
174 osrf_factory.addStep(python.PyLint(
175 env={"PYTHONPATH": ["src/python"]},
176 flunkOnFailure=False,
178 "--output-format=parseable",
179 "src/python/opensrf.py",
180 "src/python/osrf/app.py",
181 "src/python/osrf/cache.py",
182 "src/python/osrf/conf.py",
183 "src/python/osrf/const.py",
184 "src/python/osrf/ex.py",
185 "src/python/osrf/gateway.py",
186 "src/python/osrf/http_translator.py",
187 "src/python/osrf/json.py",
188 "src/python/osrf/log.py",
189 "src/python/osrf/net_obj.py",
190 "src/python/osrf/net.py",
191 "src/python/osrf/server.py",
192 "src/python/osrf/ses.py",
193 "src/python/osrf/set.py",
194 "src/python/osrf/stack.py",
195 "src/python/osrf/system.py",
196 "src/python/osrf/xml_obj.py",
197 "src/python/osrf/apps/example.py"]))
199 eg_factory = BuildFactory()
200 # check out the source
201 eg_factory.addStep(source.Git(
207 eg_factory.addStep(shell.ShellCommand(command=["./autogen.sh"]))
209 # configure (default args for now)
210 eg_factory.addStep(shell.Configure())
213 eg_factory.addStep(shell.Compile(command=["make"]))
215 perldir = 'build/Open-ILS/src/perlmods'
216 class PerlModuleTestMFHDMadness(shell.PerlModuleTest):
217 'Override PerlModuleTest with nonstandard library location for testlib.pm'
218 command = ['prove', '--lib', 'lib', '-I', 'lib/OpenILS/Utils/MFHD/test', '-r', 't']
221 def has_perl_unit_tests(step):
222 'Only run Perl tests if there are tests'
223 if (step.build.getProperty('branch') == 'rel_1_6_1'):
225 elif (step.build.getProperty('branch') == 'rel_2_0'):
229 # run the Perl unit tests
230 eg_factory.addStep(PerlModuleTestMFHDMadness(
231 doStepIf=has_perl_unit_tests,
235 # report on the Python code
236 eg_factory.addStep(python.PyLint(
237 env={"PYTHONPATH": ["Open-ILS/src/python"]},
238 flunkOnFailure=False,
240 "--output-format=parseable",
241 "Open-ILS/src/python/setup.py",
242 "Open-ILS/src/python/oils/const.py",
243 "Open-ILS/src/python/oils/event.py",
244 "Open-ILS/src/python/oils/__init__.py",
245 "Open-ILS/src/python/oils/org.py",
246 "Open-ILS/src/python/oils/srfsh.py",
247 "Open-ILS/src/python/oils/system.py",
248 "Open-ILS/src/python/oils/utils/csedit.py",
249 "Open-ILS/src/python/oils/utils/idl.py",
250 "Open-ILS/src/python/oils/utils/__init__.py",
251 "Open-ILS/src/python/oils/utils/utils.py"
255 from buildbot.config import BuilderConfig
259 for branch in OSRF_BRANCHES:
260 for distro, slave in OSRF_DISTROS:
261 build = "osrf-%s-%s" % (branch, distro)
262 c['builders'].append(BuilderConfig(name=build, slavenames=slave, factory=osrf_factory))
264 for branch in EG_BRANCHES:
265 for distro, slave in EG_DISTROS:
266 build = "evergreen-%s-%s" % (branch, distro)
267 c['builders'].append(BuilderConfig(name=build, slavenames=slave, factory=eg_factory))
269 ####### STATUS TARGETS
271 # 'status' is a list of Status Targets. The results of each build will be
272 # pushed to these targets. buildbot/status/*.py has a variety to choose from,
273 # including web pages, email senders, and IRC bots.
277 from buildbot.status import html
278 from buildbot.status.web import auth, authz
280 users = [('XXX', 'XXX'), ('XXX', 'XXX')]
281 authz_cfg = authz.Authz(
282 auth=auth.BasicAuth(users),
283 # change any of these to True to enable; see the manual for more
285 gracefulShutdown = False,
286 forceBuild = 'auth', # use this to test your slave once it is set up
287 forceAllBuilds = False,
290 stopAllBuilds = False,
291 cancelPendingBuild = False,
293 c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg))
295 # Send mail when a build is broken
296 from buildbot.status.mail import MailNotifier
298 fromaddr="buildbot@testing.esilibrary.com",
299 sendToInterestedUsers=False,
301 extraRecipients=["dan@coffeecode.net","open-ils-dev@list.georgialibraries.org"])
303 # Uncomment to actually send mail
304 # c['status'].append(mn)
306 ####### PROJECT IDENTITY
308 # the 'projectName' string will be used to describe the project that this
309 # buildbot is working on. For example, it is used as the title of the
310 # waterfall HTML page. The 'projectURL' string will be used to provide a link
311 # from buildbot HTML pages to your project's home page.
313 c['projectName'] = "Evergreen and OpenSRF"
314 c['projectURL'] = "http://evergreen-ils.org/"
316 # the 'buildbotURL' string should point to the location where the buildbot's
317 # internal web server (usually the html.WebStatus page) is visible. This
318 # typically uses the port number set in the Waterfall 'status' entry, but
319 # with an externally-visible host name which the buildbot cannot figure out
322 c['buildbotURL'] = "http://testing.evergreen-ils.org/buildbot/"
326 # This specifies what database buildbot uses to store change and scheduler
327 # state. You can leave this at its default for all but the largest
329 c['db_url'] = "sqlite:///state.sqlite"