]> git.evergreen-ils.org Git - OpenSRF.git/blob - examples/buildbot.cfg
ee87c869d04a47d038bd0abd95b6f3e0551ac2bf
[OpenSRF.git] / examples / buildbot.cfg
1 # -*- python -*-
2 # ex: set syntax=python:
3
4 # This is a sample buildmaster config file. It must be installed as
5 # 'master.cfg' in your buildmaster's base directory.
6
7 # This is the dictionary that the buildmaster pays attention to. We also use
8 # a shorter alias to save typing.
9 c = BuildmasterConfig = {}
10
11 ####### BUILDSLAVES
12
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)]
18
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
21 # --master option)
22 c['slavePortnum'] = XXX
23
24 ####### CHANGESOURCES
25
26 # the 'change_source' setting tells the buildmaster how it should find out
27 # about source code changes.  Here we point to OpenSRF:
28
29 from buildbot.changes import svnpoller
30 c['change_source'] = svnpoller.SVNPoller(
31         project='OpenSRF',
32         svnurl='svn://svn.open-ils.org/OpenSRF',
33         split_file=svnpoller.split_file_branches,
34         pollinterval=600)
35
36 ####### FILTERS
37 from buildbot.schedulers.filter import ChangeFilter
38 trunk_filter = ChangeFilter(branch="trunk")
39 rel_1_6_filter = ChangeFilter(branch="branches/rel_1_6")
40 rel_2_0_filter = ChangeFilter(branch="branches/rel_2_0")
41
42 ####### SCHEDULERS
43
44 # Configure the Schedulers, which decide how to react to incoming changes.  In this
45 # case, just kick off a 'runtests' build
46
47 from buildbot.scheduler import Scheduler
48 c['schedulers'] = []
49 c['schedulers'].append(Scheduler(name="osrf-trunk-full",
50             treeStableTimer=300,
51             change_filter=trunk_filter,
52             builderNames=["osrf-trunk-ubuntu-10.04-x86_64"]))
53
54 c['schedulers'].append(Scheduler(name="osrf-rel_1_6",
55             treeStableTimer=300,
56             change_filter=rel_1_6_filter,
57             builderNames=["osrf-rel_1_6-ubuntu-10.04-x86_64"]))
58
59 c['schedulers'].append(Scheduler(name="osrf-rel_2_0",
60             treeStableTimer=300,
61             change_filter=rel_2_0_filter,
62             builderNames=["osrf-rel_2_0-ubuntu-10.04-x86_64"]))
63
64 ####### BUILDERS
65
66 # The 'builders' list defines the Builders, which tell Buildbot how to perform a build:
67 # what steps, and which slaves can execute them.  Note that any particular build will
68 # only take place on one slave.
69
70 from buildbot.process.factory import BuildFactory
71 from buildbot.steps import source 
72 from buildbot.steps import shell
73 from buildbot.steps import python
74 from buildbot.steps import python_twisted
75
76 factory = BuildFactory()
77 # check out the source
78 factory.addStep(source.SVN(
79             baseURL='svn://svn.open-ils.org/OpenSRF/',
80             defaultBranch='trunk',
81             mode='copy'))
82
83 # bootstrap the code
84 factory.addStep(shell.ShellCommand(command=["./autogen.sh"]))
85
86 # configure (default args for now)
87 factory.addStep(shell.Configure())
88
89 # compile the code
90 factory.addStep(shell.Compile(command=["make"]))
91
92 # run the Perl unit tests
93 factory.addStep(shell.PerlModuleTest(workdir="build/src/perl"))
94
95 # run the Python unit tests (available after rel_1_6)
96 def has_python_unit_test(step):
97     return step.build.getProperty('branch') != 'branches/rel_1_6'
98
99 factory.addStep(python_twisted.Trial(
100     doStepIf=has_python_unit_test,
101         testpath="build",
102         tests="src/python/tests/json_test.py"))
103
104 # report on the Python code
105 factory.addStep(python.PyLint(
106         env={"PYTHONPATH": ["src/python"]},
107         flunkOnFailure=False,
108         command=["pylint", 
109                 "--output-format=parseable",
110                 "src/python/opensrf.py",
111                 "src/python/osrf/app.py",
112                 "src/python/osrf/cache.py",
113                 "src/python/osrf/conf.py",
114                 "src/python/osrf/const.py",
115                 "src/python/osrf/ex.py",
116                 "src/python/osrf/gateway.py",
117                 "src/python/osrf/http_translator.py",
118                 "src/python/osrf/json.py",
119                 "src/python/osrf/log.py",
120                 "src/python/osrf/net_obj.py",
121                 "src/python/osrf/net.py",
122                 "src/python/osrf/server.py",
123                 "src/python/osrf/ses.py",
124                 "src/python/osrf/set.py",
125                 "src/python/osrf/stack.py",
126                 "src/python/osrf/system.py",
127                 "src/python/osrf/xml_obj.py",
128                 "src/python/osrf/apps/example.py"]))
129
130 from buildbot.config import BuilderConfig
131
132 c['builders'] = []
133 c['builders'].append(
134     BuilderConfig(name="osrf-trunk-ubuntu-10.04-x86_64",
135       slavenames=["opensrf-slave"],
136       factory=factory))
137 c['builders'].append(
138     BuilderConfig(name="osrf-rel_1_6-ubuntu-10.04-x86_64",
139       slavenames=["opensrf-slave"],
140       factory=factory))
141 c['builders'].append(
142     BuilderConfig(name="osrf-rel_2_0-ubuntu-10.04-x86_64",
143       slavenames=["opensrf-slave"],
144       factory=factory))
145
146 ####### STATUS TARGETS
147
148 # 'status' is a list of Status Targets. The results of each build will be
149 # pushed to these targets. buildbot/status/*.py has a variety to choose from,
150 # including web pages, email senders, and IRC bots.
151
152 c['status'] = []
153
154 from buildbot.status import html
155 from buildbot.status.web import auth, authz
156
157 users = [('XXX', 'XXX'), ('XXX', 'XXX')]
158 authz_cfg=authz.Authz(
159     auth=auth.BasicAuth(users),
160     # change any of these to True to enable; see the manual for more
161     # options
162     gracefulShutdown = False,
163     forceBuild = 'auth', # use this to test your slave once it is set up
164     forceAllBuilds = False,
165     pingBuilder = False,
166     stopBuild = False,
167     stopAllBuilds = False,
168     cancelPendingBuild = False,
169 )
170 c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg))
171
172 # Send mail when a build is broken
173 from buildbot.status.mail import MailNotifier
174 mn = MailNotifier(
175     fromaddr="buildbot@testing.esilibrary.com",
176     sendToInterestedUsers=False,
177     mode='problem',
178     extraRecipients=["dan@coffeecode.net","open-ils-dev@list.georgialibraries.org"])
179 c['status'].append(mn)
180
181 ####### PROJECT IDENTITY
182
183 # the 'projectName' string will be used to describe the project that this
184 # buildbot is working on. For example, it is used as the title of the
185 # waterfall HTML page. The 'projectURL' string will be used to provide a link
186 # from buildbot HTML pages to your project's home page.
187
188 c['projectName'] = "OpenSRF"
189 c['projectURL'] = "http://evergreen-ils.org/"
190
191 # the 'buildbotURL' string should point to the location where the buildbot's
192 # internal web server (usually the html.WebStatus page) is visible. This
193 # typically uses the port number set in the Waterfall 'status' entry, but
194 # with an externally-visible host name which the buildbot cannot figure out
195 # without some help.
196
197 c['buildbotURL'] = "http://testing.evergreen-ils.org/buildbot/"
198
199 ####### DB URL
200
201 # This specifies what database buildbot uses to store change and scheduler
202 # state.  You can leave this at its default for all but the largest
203 # installations.
204 c['db_url'] = "sqlite:///state.sqlite"
205