]> git.evergreen-ils.org Git - OpenSRF.git/blob - examples/buildbot.cfg
83a87484623cc6023929b71456c137f0a17f11ad
[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 trunk',
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/%%BRANCH%%',
80             mode='copy'))
81
82 # bootstrap the code
83 factory.addStep(shell.ShellCommand(command=["./autogen.sh"]))
84
85 # configure (default args for now)
86 factory.addStep(shell.Configure())
87
88 # compile the code
89 factory.addStep(shell.Compile(command=["make"]))
90
91 # run the Perl unit tests
92 factory.addStep(shell.PerlModuleTest(workdir="build/src/perl"))
93
94 # run the Python unit tests (available after rel_1_6)
95 def has_python_unit_test(step):
96     return step.build.getProperty('branch') != 'branches/rel_1_6'
97
98 factory.addStep(python_twisted.Trial(
99     doStepIf=has_python_unit_test,
100         testpath="build",
101         tests="src/python/tests/json_test.py"))
102
103 # report on the Python code
104 factory.addStep(python.PyLint(
105         env={"PYTHONPATH": ["src/python"]},
106         flunkOnFailure=False,
107         command=["pylint", 
108                 "--output-format=parseable",
109                 "src/python/opensrf.py",
110                 "src/python/osrf/app.py",
111                 "src/python/osrf/cache.py",
112                 "src/python/osrf/conf.py",
113                 "src/python/osrf/const.py",
114                 "src/python/osrf/ex.py",
115                 "src/python/osrf/gateway.py",
116                 "src/python/osrf/http_translator.py",
117                 "src/python/osrf/json.py",
118                 "src/python/osrf/log.py",
119                 "src/python/osrf/net_obj.py",
120                 "src/python/osrf/net.py",
121                 "src/python/osrf/server.py",
122                 "src/python/osrf/ses.py",
123                 "src/python/osrf/set.py",
124                 "src/python/osrf/stack.py",
125                 "src/python/osrf/system.py",
126                 "src/python/osrf/xml_obj.py",
127                 "src/python/osrf/apps/example.py"]))
128
129 from buildbot.config import BuilderConfig
130
131 c['builders'] = []
132 c['builders'].append(
133     BuilderConfig(name="osrf-trunk-ubuntu-10.04-x86_64",
134       slavenames=["opensrf-slave"],
135       factory=factory))
136 c['builders'].append(
137     BuilderConfig(name="osrf-rel_1_6-ubuntu-10.04-x86_64",
138       slavenames=["opensrf-slave"],
139       factory=factory))
140 c['builders'].append(
141     BuilderConfig(name="osrf-rel_2_0-ubuntu-10.04-x86_64",
142       slavenames=["opensrf-slave"],
143       factory=factory))
144
145 ####### STATUS TARGETS
146
147 # 'status' is a list of Status Targets. The results of each build will be
148 # pushed to these targets. buildbot/status/*.py has a variety to choose from,
149 # including web pages, email senders, and IRC bots.
150
151 c['status'] = []
152
153 from buildbot.status import html
154 from buildbot.status.web import auth, authz
155
156 users = [('XXX', 'XXX'), ('XXX', 'XXX')]
157 authz_cfg=authz.Authz(
158     auth=auth.BasicAuth(users),
159     # change any of these to True to enable; see the manual for more
160     # options
161     gracefulShutdown = False,
162     forceBuild = 'auth', # use this to test your slave once it is set up
163     forceAllBuilds = False,
164     pingBuilder = False,
165     stopBuild = False,
166     stopAllBuilds = False,
167     cancelPendingBuild = False,
168 )
169 c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg))
170
171 # Send mail when a build is broken
172 from buildbot.status.mail import MailNotifier
173 mn = MailNotifier(
174     fromaddr="buildbot@testing.esilibrary.com",
175     sendToInterestedUsers=False,
176     mode='problem',
177     extraRecipients=["dan@coffeecode.net","open-ils-dev@list.georgialibraries.org"])
178 c['status'].append(mn)
179
180 ####### PROJECT IDENTITY
181
182 # the 'projectName' string will be used to describe the project that this
183 # buildbot is working on. For example, it is used as the title of the
184 # waterfall HTML page. The 'projectURL' string will be used to provide a link
185 # from buildbot HTML pages to your project's home page.
186
187 c['projectName'] = "OpenSRF trunk"
188 c['projectURL'] = "http://evergreen-ils.org/"
189
190 # the 'buildbotURL' string should point to the location where the buildbot's
191 # internal web server (usually the html.WebStatus page) is visible. This
192 # typically uses the port number set in the Waterfall 'status' entry, but
193 # with an externally-visible host name which the buildbot cannot figure out
194 # without some help.
195
196 c['buildbotURL'] = "http://testing.evergreen-ils.org/buildbot/"
197
198 ####### DB URL
199
200 # This specifies what database buildbot uses to store change and scheduler
201 # state.  You can leave this at its default for all but the largest
202 # installations.
203 c['db_url'] = "sqlite:///state.sqlite"
204