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-u804", "XXX", max_builds=1),
26 BuildSlave("eg-u1004", "XXX", max_builds=1)
29 # 'slavePortnum' defines the TCP port to listen on for connections from slaves.
30 # This must match the value configured into the buildslaves (with their
32 c['slavePortnum'] = XXX
34 # Branches and distros to build
35 OSRF_BRANCHES = ('master', 'rel_1_6', 'rel_2_0')
36 OSRF_DISTROS = [('ubuntu-10.04-x86_64', 'opensrf-slave')]
37 EG_BRANCHES = ('master', 'rel_1_6_1', 'rel_2_0', 'rel_2_1')
39 ('debian-6.00-x86_64', 'eg-slave'), # UPEI
40 ('ubuntu-8.04-x86', 'eg-u804'), # GPLS
41 ('ubuntu-10.04-x86', 'eg-u1004') # GPLS
44 eg_git = 'git://git.evergreen-ils.org/Evergreen.git'
45 osrf_git = 'git://git.evergreen-ils.org/OpenSRF.git'
49 # the 'change_source' setting tells the buildmaster how it should find out
50 # about source code changes
52 from buildbot.changes import gitpoller
53 c['change_source'] = []
54 for osrf_branch in OSRF_BRANCHES:
55 c['change_source'].append(gitpoller.GitPoller(
58 workdir= WORKDIR + 'buildbot_osrf_' + osrf_branch,
62 for eg_branch in EG_BRANCHES:
63 c['change_source'].append(gitpoller.GitPoller(
66 workdir= WORKDIR + 'buildbot_eg_' + eg_branch,
71 from buildbot.schedulers.filter import ChangeFilter
72 master_filter = ChangeFilter(project='OpenSRF', branch="master")
73 rel_1_6_filter = ChangeFilter(project='OpenSRF', branch="rel_1_6")
74 rel_2_0_filter = ChangeFilter(project='OpenSRF', branch="rel_2_0")
75 eg_rel_1_6_1_filter = ChangeFilter(project='Evergreen', branch="rel_1_6_1")
76 eg_rel_2_0_filter = ChangeFilter(project='Evergreen', branch="rel_2_0")
77 eg_rel_2_1_filter = ChangeFilter(project='Evergreen', branch="rel_2_1")
78 eg_master_filter = ChangeFilter(project='Evergreen', branch="master")
82 # Configure the Schedulers, which decide how to react to incoming changes. In this
83 # case, just kick off a 'runtests' build
85 from buildbot.scheduler import SingleBranchScheduler
87 c['schedulers'].append(SingleBranchScheduler(name="osrf-master-full",
89 change_filter=master_filter,
90 builderNames=["osrf-master-ubuntu-10.04-x86_64"]))
92 c['schedulers'].append(SingleBranchScheduler(name="osrf-rel_1_6",
94 change_filter=rel_1_6_filter,
95 builderNames=["osrf-rel_1_6-ubuntu-10.04-x86_64"]))
97 c['schedulers'].append(SingleBranchScheduler(name="osrf-rel_2_0",
99 change_filter=rel_2_0_filter,
100 builderNames=["osrf-rel_2_0-ubuntu-10.04-x86_64"]))
102 c['schedulers'].append(SingleBranchScheduler(name="evergreen-rel_1_6_1",
104 change_filter=eg_rel_1_6_1_filter,
106 "evergreen-rel_1_6_1-debian-6.00-x86_64",
107 "evergreen-rel_1_6_1-ubuntu-8.04-x86",
108 "evergreen-rel_1_6_1-ubuntu-10.04-x86"
111 c['schedulers'].append(SingleBranchScheduler(name="evergreen-rel_2_0",
113 change_filter=eg_rel_2_0_filter,
115 "evergreen-rel_2_0-debian-6.00-x86_64",
116 "evergreen-rel_2_0-ubuntu-8.04-x86",
117 "evergreen-rel_2_0-ubuntu-10.04-x86"
120 c['schedulers'].append(SingleBranchScheduler(name="evergreen-rel_2_1",
122 change_filter=eg_rel_2_1_filter,
124 "evergreen-rel_2_1-debian-6.00-x86_64",
125 "evergreen-rel_2_1-ubuntu-8.04-x86",
126 "evergreen-rel_2_1-ubuntu-10.04-x86"
129 c['schedulers'].append(SingleBranchScheduler(name="evergreen-master",
131 change_filter=eg_master_filter,
133 "evergreen-master-debian-6.00-x86_64",
134 "evergreen-master-ubuntu-8.04-x86",
135 "evergreen-master-ubuntu-10.04-x86"
140 # The 'builders' list defines the Builders, which tell Buildbot how to perform a build:
141 # what steps, and which slaves can execute them. Note that any particular build will
142 # only take place on one slave.
144 from buildbot.process.factory import BuildFactory
145 from buildbot.steps import source
146 from buildbot.steps import shell
147 from buildbot.steps import python
148 from buildbot.steps import python_twisted
150 osrf_factory = BuildFactory()
151 # check out the source
152 osrf_factory.addStep(source.Git(
158 osrf_factory.addStep(shell.ShellCommand(command=["./autogen.sh"]))
160 # configure (default args for now)
161 osrf_factory.addStep(shell.Configure())
164 osrf_factory.addStep(shell.Compile(command=["make"]))
166 # run the Perl unit tests
167 osrf_factory.addStep(shell.PerlModuleTest(workdir="build/src/perl"))
169 # run the Python unit tests (available after rel_1_6)
170 def has_python_unit_test(step):
171 return step.build.getProperty('branch') != 'rel_1_6'
173 osrf_factory.addStep(python_twisted.Trial(
174 doStepIf=has_python_unit_test,
176 tests="src/python/tests/json_test.py"))
178 # report on the Python code
179 osrf_factory.addStep(python.PyLint(
180 env={"PYTHONPATH": ["src/python"]},
181 flunkOnFailure=False,
183 "--output-format=parseable",
184 "src/python/opensrf.py",
185 "src/python/osrf/app.py",
186 "src/python/osrf/cache.py",
187 "src/python/osrf/conf.py",
188 "src/python/osrf/const.py",
189 "src/python/osrf/ex.py",
190 "src/python/osrf/gateway.py",
191 "src/python/osrf/http_translator.py",
192 "src/python/osrf/json.py",
193 "src/python/osrf/log.py",
194 "src/python/osrf/net_obj.py",
195 "src/python/osrf/net.py",
196 "src/python/osrf/server.py",
197 "src/python/osrf/ses.py",
198 "src/python/osrf/set.py",
199 "src/python/osrf/stack.py",
200 "src/python/osrf/system.py",
201 "src/python/osrf/xml_obj.py",
202 "src/python/osrf/apps/example.py"]))
204 eg_factory = BuildFactory()
205 # check out the source
206 eg_factory.addStep(source.Git(
212 eg_factory.addStep(shell.ShellCommand(command=["./autogen.sh"]))
214 # configure (default args for now)
215 eg_factory.addStep(shell.Configure())
218 eg_factory.addStep(shell.Compile(command=["make"]))
220 perldir = 'build/Open-ILS/src/perlmods'
221 class PerlModuleTestMFHDMadness(shell.PerlModuleTest):
222 'Override PerlModuleTest with nonstandard library location for testlib.pm'
223 command = ['prove', '--lib', 'lib', '-I', 'lib/OpenILS/Utils/MFHD/test', '-r', 't']
226 def has_perl_unit_tests(step):
227 'Only run Perl tests if there are tests'
228 if (step.build.getProperty('branch') == 'rel_1_6_1'):
230 elif (step.build.getProperty('branch') == 'rel_2_0'):
234 # run the Perl unit tests
235 eg_factory.addStep(PerlModuleTestMFHDMadness(
236 doStepIf=has_perl_unit_tests,
240 # report on the Python code
241 eg_factory.addStep(python.PyLint(
242 env={"PYTHONPATH": ["Open-ILS/src/python"]},
243 flunkOnFailure=False,
245 "--output-format=parseable",
246 "Open-ILS/src/python/setup.py",
247 "Open-ILS/src/python/oils/const.py",
248 "Open-ILS/src/python/oils/event.py",
249 "Open-ILS/src/python/oils/__init__.py",
250 "Open-ILS/src/python/oils/org.py",
251 "Open-ILS/src/python/oils/srfsh.py",
252 "Open-ILS/src/python/oils/system.py",
253 "Open-ILS/src/python/oils/utils/csedit.py",
254 "Open-ILS/src/python/oils/utils/idl.py",
255 "Open-ILS/src/python/oils/utils/__init__.py",
256 "Open-ILS/src/python/oils/utils/utils.py"
260 from buildbot.config import BuilderConfig
264 for branch in OSRF_BRANCHES:
265 for distro, slave in OSRF_DISTROS:
266 build = "osrf-%s-%s" % (branch, distro)
267 c['builders'].append(BuilderConfig(name=build, slavenames=slave, factory=osrf_factory))
269 for branch in EG_BRANCHES:
270 for distro, slave in EG_DISTROS:
271 build = "evergreen-%s-%s" % (branch, distro)
272 c['builders'].append(BuilderConfig(name=build, slavenames=slave, factory=eg_factory))
274 ####### STATUS TARGETS
276 # 'status' is a list of Status Targets. The results of each build will be
277 # pushed to these targets. buildbot/status/*.py has a variety to choose from,
278 # including web pages, email senders, and IRC bots.
282 from buildbot.status import html
283 from buildbot.status.web import auth, authz
285 users = [('XXX', 'XXX'), ('XXX', 'XXX')]
286 authz_cfg = authz.Authz(
287 auth=auth.BasicAuth(users),
288 # change any of these to True to enable; see the manual for more
290 gracefulShutdown = False,
291 forceBuild = 'auth', # use this to test your slave once it is set up
292 forceAllBuilds = False,
295 stopAllBuilds = False,
296 cancelPendingBuild = False,
298 c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg))
300 # Send mail when a build is broken
301 from buildbot.status.mail import MailNotifier
303 fromaddr="buildbot@testing.evergreen-ils.org",
304 sendToInterestedUsers=True,
306 # , extraRecipients=["dan@coffeecode.net","open-ils-dev@list.georgialibraries.org"]
309 # Uncomment to actually send mail
310 c['status'].append(MN)
313 from buildbot.status import words
314 IRC = words.IRC("chat.freenode.net", "egbuilder",
315 channels=["#evergreen"],
320 'successToFailure': 1,
321 'failureToSuccess': 1,
323 c['status'].append(IRC)
325 ####### PROJECT IDENTITY
327 # the 'projectName' string will be used to describe the project that this
328 # buildbot is working on. For example, it is used as the title of the
329 # waterfall HTML page. The 'projectURL' string will be used to provide a link
330 # from buildbot HTML pages to your project's home page.
332 c['projectName'] = "Evergreen and OpenSRF"
333 c['projectURL'] = "http://evergreen-ils.org/"
335 # the 'buildbotURL' string should point to the location where the buildbot's
336 # internal web server (usually the html.WebStatus page) is visible. This
337 # typically uses the port number set in the Waterfall 'status' entry, but
338 # with an externally-visible host name which the buildbot cannot figure out
341 c['buildbotURL'] = "http://testing.evergreen-ils.org/buildbot/"
345 # This specifies what database buildbot uses to store change and scheduler
346 # state. You can leave this at its default for all but the largest
348 c['db_url'] = "sqlite:///state.sqlite"