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'] = (
60 from buildbot.schedulers.filter import ChangeFilter
61 master_filter = ChangeFilter(project='OpenSRF', branch="master")
62 rel_1_6_filter = ChangeFilter(project='OpenSRF', branch="rel_1_6")
63 rel_2_0_filter = ChangeFilter(project='OpenSRF', branch="rel_2_0")
64 eg_rel_1_6_1_filter = ChangeFilter(project='Evergreen', branch="rel_1_6_1")
65 eg_rel_2_0_filter = ChangeFilter(project='Evergreen', branch="rel_2_0")
66 eg_rel_2_1_filter = ChangeFilter(project='Evergreen', branch="rel_2_1")
67 eg_master_filter = ChangeFilter(project='Evergreen', branch="master")
71 # Configure the Schedulers, which decide how to react to incoming changes. In this
72 # case, just kick off a 'runtests' build
74 from buildbot.scheduler import Scheduler
76 c['schedulers'].append(Scheduler(name="osrf-master-full",
78 change_filter=master_filter,
79 builderNames=["osrf-master-ubuntu-10.04-x86_64"]))
81 c['schedulers'].append(Scheduler(name="osrf-rel_1_6",
83 change_filter=rel_1_6_filter,
84 builderNames=["osrf-rel_1_6-ubuntu-10.04-x86_64"]))
86 c['schedulers'].append(Scheduler(name="osrf-rel_2_0",
88 change_filter=rel_2_0_filter,
89 builderNames=["osrf-rel_2_0-ubuntu-10.04-x86_64"]))
91 c['schedulers'].append(Scheduler(name="evergreen-rel_1_6_1",
93 change_filter=eg_rel_1_6_1_filter,
95 "evergreen-rel_1_6_1-debian-6.00-x86_64",
96 "evergreen-rel_1_6_1-ubuntu-8.04-x86",
97 "evergreen-rel_1_6_1-ubuntu-10.04-x86"
100 c['schedulers'].append(Scheduler(name="evergreen-rel_2_0",
102 change_filter=eg_rel_2_0_filter,
104 "evergreen-rel_2_0-debian-6.00-x86_64",
105 "evergreen-rel_2_0-ubuntu-8.04-x86",
106 "evergreen-rel_2_0-ubuntu-10.04-x86"
109 c['schedulers'].append(Scheduler(name="evergreen-rel_2_1",
111 change_filter=eg_rel_2_1_filter,
113 "evergreen-rel_2_1-debian-6.00-x86_64",
114 "evergreen-rel_2_1-ubuntu-8.04-x86",
115 "evergreen-rel_2_1-ubuntu-10.04-x86"
118 c['schedulers'].append(Scheduler(name="evergreen-master",
120 change_filter=eg_master_filter,
122 "evergreen-master-debian-6.00-x86_64",
123 "evergreen-master-ubuntu-8.04-x86",
124 "evergreen-master-ubuntu-10.04-x86"
129 # The 'builders' list defines the Builders, which tell Buildbot how to perform a build:
130 # what steps, and which slaves can execute them. Note that any particular build will
131 # only take place on one slave.
133 from buildbot.process.factory import BuildFactory
134 from buildbot.steps import source
135 from buildbot.steps import shell
136 from buildbot.steps import python
137 from buildbot.steps import python_twisted
139 osrf_factory = BuildFactory()
140 # check out the source
141 osrf_factory.addStep(source.Git(
147 osrf_factory.addStep(shell.ShellCommand(command=["./autogen.sh"]))
149 # configure (default args for now)
150 osrf_factory.addStep(shell.Configure())
153 osrf_factory.addStep(shell.Compile(command=["make"]))
155 # run the Perl unit tests
156 osrf_factory.addStep(shell.PerlModuleTest(workdir="build/src/perl"))
158 # run the Python unit tests (available after rel_1_6)
159 def has_python_unit_test(step):
160 return step.build.getProperty('branch') != 'branches/rel_1_6'
162 osrf_factory.addStep(python_twisted.Trial(
163 doStepIf=has_python_unit_test,
165 tests="src/python/tests/json_test.py"))
167 # report on the Python code
168 osrf_factory.addStep(python.PyLint(
169 env={"PYTHONPATH": ["src/python"]},
170 flunkOnFailure=False,
172 "--output-format=parseable",
173 "src/python/opensrf.py",
174 "src/python/osrf/app.py",
175 "src/python/osrf/cache.py",
176 "src/python/osrf/conf.py",
177 "src/python/osrf/const.py",
178 "src/python/osrf/ex.py",
179 "src/python/osrf/gateway.py",
180 "src/python/osrf/http_translator.py",
181 "src/python/osrf/json.py",
182 "src/python/osrf/log.py",
183 "src/python/osrf/net_obj.py",
184 "src/python/osrf/net.py",
185 "src/python/osrf/server.py",
186 "src/python/osrf/ses.py",
187 "src/python/osrf/set.py",
188 "src/python/osrf/stack.py",
189 "src/python/osrf/system.py",
190 "src/python/osrf/xml_obj.py",
191 "src/python/osrf/apps/example.py"]))
193 eg_factory = BuildFactory()
194 # check out the source
195 eg_factory.addStep(source.Git(
201 eg_factory.addStep(shell.ShellCommand(command=["./autogen.sh"]))
203 # configure (default args for now)
204 eg_factory.addStep(shell.Configure())
207 eg_factory.addStep(shell.Compile(command=["make"]))
209 perldir = 'build/Open-ILS/src/perlmods'
210 class PerlModuleTestMFHDMadness(shell.PerlModuleTest):
211 'Override PerlModuleTest with nonstandard library location for testlib.pm'
212 command = ['prove', '--lib', 'lib', '-I', 'lib/OpenILS/Utils/MFHD/test', '-r', 't']
215 def has_perl_unit_tests(step):
216 'Only run Perl tests if there are tests'
217 if (step.build.getProperty('branch') == 'branches/rel_1_6_1'):
219 elif (step.build.getProperty('branch') == 'branches/rel_2_0'):
223 # run the Perl unit tests
224 eg_factory.addStep(PerlModuleTestMFHDMadness(
225 doStepIf=has_perl_unit_tests,
229 # report on the Python code
230 eg_factory.addStep(python.PyLint(
231 env={"PYTHONPATH": ["Open-ILS/src/python"]},
232 flunkOnFailure=False,
234 "--output-format=parseable",
235 "Open-ILS/src/python/setup.py",
236 "Open-ILS/src/python/oils/const.py",
237 "Open-ILS/src/python/oils/event.py",
238 "Open-ILS/src/python/oils/__init__.py",
239 "Open-ILS/src/python/oils/org.py",
240 "Open-ILS/src/python/oils/srfsh.py",
241 "Open-ILS/src/python/oils/system.py",
242 "Open-ILS/src/python/oils/utils/csedit.py",
243 "Open-ILS/src/python/oils/utils/idl.py",
244 "Open-ILS/src/python/oils/utils/__init__.py",
245 "Open-ILS/src/python/oils/utils/utils.py"
249 from buildbot.config import BuilderConfig
253 for branch in osrf_branches:
254 for distro, slave in osrf_distros:
255 build = "osrf-%s-%s" % (branch, distro)
256 c['builders'].append(BuilderConfig(name=build, slavenames=slave, factory=osrf_factory))
258 for branch in eg_branches:
259 for distro, slave in eg_distros:
260 build = "evergreen-%s-%s" % (branch, distro)
261 c['builders'].append(BuilderConfig(name=build, slavenames=slave, factory=eg_factory))
263 ####### STATUS TARGETS
265 # 'status' is a list of Status Targets. The results of each build will be
266 # pushed to these targets. buildbot/status/*.py has a variety to choose from,
267 # including web pages, email senders, and IRC bots.
271 from buildbot.status import html
272 from buildbot.status.web import auth, authz
274 users = [('XXX', 'XXX'), ('XXX', 'XXX')]
275 authz_cfg = authz.Authz(
276 auth=auth.BasicAuth(users),
277 # change any of these to True to enable; see the manual for more
279 gracefulShutdown = False,
280 forceBuild = 'auth', # use this to test your slave once it is set up
281 forceAllBuilds = False,
284 stopAllBuilds = False,
285 cancelPendingBuild = False,
287 c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg))
289 # Send mail when a build is broken
290 from buildbot.status.mail import MailNotifier
292 fromaddr="buildbot@testing.esilibrary.com",
293 sendToInterestedUsers=False,
295 extraRecipients=["dan@coffeecode.net","open-ils-dev@list.georgialibraries.org"])
297 # Uncomment to actually send mail
298 # c['status'].append(mn)
300 ####### PROJECT IDENTITY
302 # the 'projectName' string will be used to describe the project that this
303 # buildbot is working on. For example, it is used as the title of the
304 # waterfall HTML page. The 'projectURL' string will be used to provide a link
305 # from buildbot HTML pages to your project's home page.
307 c['projectName'] = "Evergreen and OpenSRF"
308 c['projectURL'] = "http://evergreen-ils.org/"
310 # the 'buildbotURL' string should point to the location where the buildbot's
311 # internal web server (usually the html.WebStatus page) is visible. This
312 # typically uses the port number set in the Waterfall 'status' entry, but
313 # with an externally-visible host name which the buildbot cannot figure out
316 c['buildbotURL'] = "http://testing.evergreen-ils.org/buildbot/"
320 # This specifies what database buildbot uses to store change and scheduler
321 # state. You can leave this at its default for all but the largest
323 c['db_url'] = "sqlite:///state.sqlite"