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 = {}
11 # WORKDIR must be an absolute path that is not volatile; systems
12 # like Ubuntu wipe /tmp/ on a reboot, for example, which is
13 # disastrous for build history, at least for gitpoller
14 WORKDIR = '/home/buildmaster/'
18 # The 'slaves' list defines the set of recognized buildslaves. Each element is
19 # a BuildSlave object, specifying a username and password. The same username and
20 # password must be configured on the slave.
21 from buildbot.buildslave import BuildSlave
23 BuildSlave("opensrf-slave", "XXX", max_builds=1),
24 BuildSlave("eg-slave", "XXX", max_builds=1),
25 BuildSlave("eg-u1004", "XXX", max_builds=1)
28 # 'slavePortnum' defines the TCP port to listen on for connections from slaves.
29 # This must match the value configured into the buildslaves (with their
31 c['slavePortnum'] = XXX
33 # Branches and distros to build
34 OSRF_BRANCHES = ('master', 'rel_2_1', 'rel_2_0')
35 OSRF_DISTROS = [('ubuntu-10.04-x86_64', 'opensrf-slave')]
36 EG_BRANCHES = ('master', 'rel_2_2', 'rel_2_0', 'rel_2_1')
38 ('debian-6.00-x86_64', 'eg-slave'), # UPEI
39 ('ubuntu-10.04-x86', 'eg-u1004') # GPLS
42 eg_git = 'git://git.evergreen-ils.org/Evergreen.git'
43 osrf_git = 'git://git.evergreen-ils.org/OpenSRF.git'
47 # the 'change_source' setting tells the buildmaster how it should find out
48 # about source code changes
50 from buildbot.changes import gitpoller
51 c['change_source'] = []
52 for osrf_branch in OSRF_BRANCHES:
53 c['change_source'].append(gitpoller.GitPoller(
56 workdir= WORKDIR + 'buildbot_osrf_' + osrf_branch,
60 for eg_branch in EG_BRANCHES:
61 c['change_source'].append(gitpoller.GitPoller(
64 workdir= WORKDIR + 'buildbot_eg_' + eg_branch,
69 from buildbot.changes.filter import ChangeFilter
70 master_filter = ChangeFilter(project='OpenSRF', branch="master")
71 rel_2_0_filter = ChangeFilter(project='OpenSRF', branch="rel_2_0")
72 rel_2_1_filter = ChangeFilter(project='OpenSRF', branch="rel_2_1")
73 eg_rel_2_0_filter = ChangeFilter(project='Evergreen', branch="rel_2_0")
74 eg_rel_2_1_filter = ChangeFilter(project='Evergreen', branch="rel_2_1")
75 eg_rel_2_2_filter = ChangeFilter(project='Evergreen', branch="rel_2_2")
76 eg_master_filter = ChangeFilter(project='Evergreen', branch="master")
80 # Configure the Schedulers, which decide how to react to incoming changes. In this
81 # case, just kick off a 'runtests' build
83 from buildbot.schedulers.basic import SingleBranchScheduler
85 c['schedulers'].append(SingleBranchScheduler(name="osrf-master-full",
87 change_filter=master_filter,
88 builderNames=["osrf-master-ubuntu-10.04-x86_64"]))
90 c['schedulers'].append(SingleBranchScheduler(name="osrf-rel_2_1",
92 change_filter=rel_2_1_filter,
93 builderNames=["osrf-rel_2_1-ubuntu-10.04-x86_64"]))
95 c['schedulers'].append(SingleBranchScheduler(name="osrf-rel_2_0",
97 change_filter=rel_2_0_filter,
98 builderNames=["osrf-rel_2_0-ubuntu-10.04-x86_64"]))
100 c['schedulers'].append(SingleBranchScheduler(name="evergreen-rel_2_2",
102 change_filter=eg_rel_2_2_filter,
104 "evergreen-rel_2_2-debian-6.00-x86_64",
105 "evergreen-rel_2_2-ubuntu-10.04-x86"
108 c['schedulers'].append(SingleBranchScheduler(name="evergreen-rel_2_0",
110 change_filter=eg_rel_2_0_filter,
112 "evergreen-rel_2_0-debian-6.00-x86_64",
113 "evergreen-rel_2_0-ubuntu-10.04-x86"
116 c['schedulers'].append(SingleBranchScheduler(name="evergreen-rel_2_1",
118 change_filter=eg_rel_2_1_filter,
120 "evergreen-rel_2_1-debian-6.00-x86_64",
121 "evergreen-rel_2_1-ubuntu-10.04-x86"
124 c['schedulers'].append(SingleBranchScheduler(name="evergreen-master",
126 change_filter=eg_master_filter,
128 "evergreen-master-debian-6.00-x86_64",
129 "evergreen-master-ubuntu-10.04-x86"
134 # The 'builders' list defines the Builders, which tell Buildbot how to perform a build:
135 # what steps, and which slaves can execute them. Note that any particular build will
136 # only take place on one slave.
138 from buildbot.process.factory import BuildFactory
139 from buildbot.steps import source
140 from buildbot.steps import shell
141 from buildbot.steps import python
142 from buildbot.steps import python_twisted
144 osrf_factory = BuildFactory()
145 # check out the source
146 osrf_factory.addStep(source.Git(
151 # bootstrap the code - old branches require autogen.sh
152 if (step.build.getProperty('branch') == 'rel_2_0'):
153 osrf_factory.addStep(shell.ShellCommand(command=["./autogen.sh"]))
155 osrf_factory.addStep(shell.ShellCommand(command=["autoreconf -f -i"]))
157 # configure (default args for now)
158 osrf_factory.addStep(shell.Configure())
161 osrf_factory.addStep(shell.Compile(command=["make"]))
163 # run the Perl unit tests
164 osrf_factory.addStep(shell.PerlModuleTest(workdir="build/src/perl"))
166 osrf_factory.addStep(python_twisted.Trial(
168 tests="src/python/tests/json_test.py"))
170 # report on the Python code
171 osrf_factory.addStep(python.PyLint(
172 env={"PYTHONPATH": ["src/python"]},
173 flunkOnFailure=False,
175 "--output-format=parseable",
176 "src/python/opensrf.py",
177 "src/python/osrf/app.py",
178 "src/python/osrf/cache.py",
179 "src/python/osrf/conf.py",
180 "src/python/osrf/const.py",
181 "src/python/osrf/ex.py",
182 "src/python/osrf/gateway.py",
183 "src/python/osrf/http_translator.py",
184 "src/python/osrf/json.py",
185 "src/python/osrf/log.py",
186 "src/python/osrf/net_obj.py",
187 "src/python/osrf/net.py",
188 "src/python/osrf/server.py",
189 "src/python/osrf/ses.py",
190 "src/python/osrf/set.py",
191 "src/python/osrf/stack.py",
192 "src/python/osrf/system.py",
193 "src/python/osrf/xml_obj.py",
194 "src/python/osrf/apps/example.py"]))
196 eg_factory = BuildFactory()
197 # check out the source
198 eg_factory.addStep(source.Git(
203 # bootstrap the code - old branches require autogen.sh
204 if (step.build.getProperty('branch') == 'rel_2_0' or
205 step.build.getProperty('branch') == 'rel_2_1'
207 eg_factory.addStep(shell.ShellCommand(command=["./autogen.sh"]))
209 eg_factory.addStep(shell.ShellCommand(command=["autoreconf -f -i"]))
211 # configure (default args for now)
212 eg_factory.addStep(shell.Configure())
215 eg_factory.addStep(shell.Compile(command=["make"]))
217 perldir = 'build/Open-ILS/src/perlmods'
218 class PerlModuleTestMFHDMadness(shell.PerlModuleTest):
219 'Override PerlModuleTest with nonstandard library location for testlib.pm'
220 command = ['prove', '--lib', 'lib', '-I', 'lib/OpenILS/Utils/MFHD/test', '-r', 't']
223 def has_perl_unit_tests(step):
224 'Only run Perl tests if there are tests'
225 if (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.evergreen-ils.org",
299 sendToInterestedUsers=True,
301 # , extraRecipients=["dan@coffeecode.net","open-ils-dev@list.georgialibraries.org"]
304 # Uncomment to actually send mail
305 c['status'].append(MN)
308 from buildbot.status import words
309 IRC = words.IRC("chat.freenode.net", "egbuilder",
310 channels=["#evergreen"],
315 'successToFailure': 1,
316 'failureToSuccess': 1,
318 c['status'].append(IRC)
320 ####### PROJECT IDENTITY
322 # the 'projectName' string will be used to describe the project that this
323 # buildbot is working on. For example, it is used as the title of the
324 # waterfall HTML page. The 'projectURL' string will be used to provide a link
325 # from buildbot HTML pages to your project's home page.
327 c['projectName'] = "Evergreen and OpenSRF"
328 c['projectURL'] = "http://evergreen-ils.org/"
330 # the 'buildbotURL' string should point to the location where the buildbot's
331 # internal web server (usually the html.WebStatus page) is visible. This
332 # typically uses the port number set in the Waterfall 'status' entry, but
333 # with an externally-visible host name which the buildbot cannot figure out
336 c['buildbotURL'] = "http://testing.evergreen-ils.org/buildbot/"
340 # This specifies what database buildbot uses to store change and scheduler
341 # state. You can leave this at its default for all but the largest
343 c['db_url'] = "sqlite:///state.sqlite"