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
17 c['slaves'] = [BuildSlave("XXX", "XXX", max_builds=1)]
19 # 'slavePortnum' defines the TCP port to listen on for connections from slaves.
20 # This must match the value configured into the buildslaves (with their
22 c['slavePortnum'] = XXX
26 # the 'change_source' setting tells the buildmaster how it should find out
27 # about source code changes. Here we point to OpenSRF:
28 def split_file_branches_trunk(path):
29 pieces = path.split('/')
30 if pieces[0] == 'trunk':
31 return ('trunk', '/'.join(pieces[1:]))
32 elif pieces[0] == 'branches':
33 return ('/'.join(pieces[0:2]),
38 from buildbot.changes import svnpoller
39 c['change_source'] = svnpoller.SVNPoller(
41 svnurl='svn://svn.open-ils.org/OpenSRF',
42 split_file=svnpoller.split_file_branches,
46 from buildbot.schedulers.filter import ChangeFilter
47 trunk_filter = ChangeFilter(branch=None)
48 rel_1_6_filter = ChangeFilter(branch="branches/rel_1_6")
49 rel_2_0_filter = ChangeFilter(branch="branches/rel_2_0")
53 # Configure the Schedulers, which decide how to react to incoming changes. In this
54 # case, just kick off a 'runtests' build
56 from buildbot.scheduler import Scheduler
58 c['schedulers'].append(Scheduler(name="osrf-trunk-full",
60 change_filter=trunk_filter,
61 builderNames=["osrf-trunk-ubuntu-10.04-x86_64"]))
63 c['schedulers'].append(Scheduler(name="osrf-rel_1_6",
65 change_filter=rel_1_6_filter,
66 builderNames=["osrf-rel_1_6-ubuntu-10.04-x86_64"]))
68 c['schedulers'].append(Scheduler(name="osrf-rel_2_0",
70 change_filter=rel_2_0_filter,
71 builderNames=["osrf-rel_2_0-ubuntu-10.04-x86_64"]))
75 # The 'builders' list defines the Builders, which tell Buildbot how to perform a build:
76 # what steps, and which slaves can execute them. Note that any particular build will
77 # only take place on one slave.
79 from buildbot.process.factory import BuildFactory
80 from buildbot.steps import source
81 from buildbot.steps import shell
82 from buildbot.steps import python
83 from buildbot.steps import python_twisted
85 factory = BuildFactory()
86 # check out the source
87 factory.addStep(source.SVN(
88 baseURL='svn://svn.open-ils.org/OpenSRF/',
89 defaultBranch='trunk',
93 factory.addStep(shell.ShellCommand(command=["./autogen.sh"]))
95 # configure (default args for now)
96 factory.addStep(shell.Configure())
99 factory.addStep(shell.Compile(command=["make"]))
101 # run the Perl unit tests
102 factory.addStep(shell.PerlModuleTest(workdir="build/src/perl"))
104 # run the Python unit tests (available after rel_1_6)
105 def has_python_unit_test(step):
106 return step.build.getProperty('branch') != 'branches/rel_1_6'
108 factory.addStep(python_twisted.Trial(
109 doStepIf=has_python_unit_test,
111 tests="src/python/tests/json_test.py"))
113 # report on the Python code
114 factory.addStep(python.PyLint(
115 env={"PYTHONPATH": ["src/python"]},
116 flunkOnFailure=False,
118 "--output-format=parseable",
119 "src/python/opensrf.py",
120 "src/python/osrf/app.py",
121 "src/python/osrf/cache.py",
122 "src/python/osrf/conf.py",
123 "src/python/osrf/const.py",
124 "src/python/osrf/ex.py",
125 "src/python/osrf/gateway.py",
126 "src/python/osrf/http_translator.py",
127 "src/python/osrf/json.py",
128 "src/python/osrf/log.py",
129 "src/python/osrf/net_obj.py",
130 "src/python/osrf/net.py",
131 "src/python/osrf/server.py",
132 "src/python/osrf/ses.py",
133 "src/python/osrf/set.py",
134 "src/python/osrf/stack.py",
135 "src/python/osrf/system.py",
136 "src/python/osrf/xml_obj.py",
137 "src/python/osrf/apps/example.py"]))
139 from buildbot.config import BuilderConfig
142 c['builders'].append(
143 BuilderConfig(name="osrf-trunk-ubuntu-10.04-x86_64",
144 slavenames=["opensrf-slave"],
146 c['builders'].append(
147 BuilderConfig(name="osrf-rel_1_6-ubuntu-10.04-x86_64",
148 slavenames=["opensrf-slave"],
150 c['builders'].append(
151 BuilderConfig(name="osrf-rel_2_0-ubuntu-10.04-x86_64",
152 slavenames=["opensrf-slave"],
155 ####### STATUS TARGETS
157 # 'status' is a list of Status Targets. The results of each build will be
158 # pushed to these targets. buildbot/status/*.py has a variety to choose from,
159 # including web pages, email senders, and IRC bots.
163 from buildbot.status import html
164 from buildbot.status.web import auth, authz
166 users = [('XXX', 'XXX'), ('XXX', 'XXX')]
167 authz_cfg=authz.Authz(
168 auth=auth.BasicAuth(users),
169 # change any of these to True to enable; see the manual for more
171 gracefulShutdown = False,
172 forceBuild = 'auth', # use this to test your slave once it is set up
173 forceAllBuilds = False,
176 stopAllBuilds = False,
177 cancelPendingBuild = False,
179 c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg))
181 # Send mail when a build is broken
182 from buildbot.status.mail import MailNotifier
184 fromaddr="buildbot@testing.esilibrary.com",
185 sendToInterestedUsers=False,
187 extraRecipients=["dan@coffeecode.net","open-ils-dev@list.georgialibraries.org"])
188 c['status'].append(mn)
190 ####### PROJECT IDENTITY
192 # the 'projectName' string will be used to describe the project that this
193 # buildbot is working on. For example, it is used as the title of the
194 # waterfall HTML page. The 'projectURL' string will be used to provide a link
195 # from buildbot HTML pages to your project's home page.
197 c['projectName'] = "OpenSRF"
198 c['projectURL'] = "http://evergreen-ils.org/"
200 # the 'buildbotURL' string should point to the location where the buildbot's
201 # internal web server (usually the html.WebStatus page) is visible. This
202 # typically uses the port number set in the Waterfall 'status' entry, but
203 # with an externally-visible host name which the buildbot cannot figure out
206 c['buildbotURL'] = "http://testing.evergreen-ils.org/buildbot/"
210 # This specifies what database buildbot uses to store change and scheduler
211 # state. You can leave this at its default for all but the largest
213 c['db_url'] = "sqlite:///state.sqlite"