|
| 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 (although the filename |
| 6 | +# can be changed with the --basedir option to 'mktap buildbot master'). |
| 7 | + |
| 8 | +# It has one job: define a dictionary named BuildmasterConfig. This |
| 9 | +# dictionary has a variety of keys to control different aspects of the |
| 10 | +# buildmaster. They are documented in docs/config.xhtml . |
| 11 | + |
| 12 | +PYTHON_VERSIONS = ('2.4', '2.5', '2.6', '2.7', '3.2') |
| 13 | + |
| 14 | + |
| 15 | +# This is the dictionary that the buildmaster pays attention to. We also use |
| 16 | +# a shorter alias to save typing. |
| 17 | +c = BuildmasterConfig = {} |
| 18 | + |
| 19 | +####### DB URL |
| 20 | + |
| 21 | +# This specifies what database buildbot uses to store change and scheduler |
| 22 | +# state |
| 23 | +c['db_url'] = "sqlite:///state.sqlite" |
| 24 | + |
| 25 | +####### BUILDSLAVES |
| 26 | + |
| 27 | +# the 'slaves' list defines the set of allowable buildslaves. Each element is |
| 28 | +# a BuildSlave object, which is created with bot-name, bot-password. These |
| 29 | +# correspond to values given to the buildslave's mktap invocation. |
| 30 | +from buildbot.buildslave import BuildSlave |
| 31 | +c['slaves'] = [BuildSlave("bot1linux", "imtheslave")] |
| 32 | + |
| 33 | +# to limit to two concurrent builds on a slave, use |
| 34 | +# c['slaves'] = [BuildSlave("bot1name", "bot1passwd", max_builds=2)] |
| 35 | + |
| 36 | + |
| 37 | +# 'slavePortnum' defines the TCP port to listen on. This must match the value |
| 38 | +# configured into the buildslaves (with their --master option) |
| 39 | + |
| 40 | +c['slavePortnum'] = 9989 |
| 41 | + |
| 42 | +####### CHANGESOURCES |
| 43 | + |
| 44 | +# the 'change_source' setting tells the buildmaster how it should find out |
| 45 | +# about source code changes. Any class which implements IChangeSource can be |
| 46 | +# put here: there are several in buildbot/changes/*.py to choose from. |
| 47 | + |
| 48 | +from buildbot.changes.pb import PBChangeSource |
| 49 | +c['change_source'] = PBChangeSource() |
| 50 | + |
| 51 | +from googlecode_atom import GoogleCodeAtomPoller |
| 52 | +poller = GoogleCodeAtomPoller( |
| 53 | + feedurl="http://code.google.com/feeds/p/python-sqlparse/hgchanges/basic", |
| 54 | + pollinterval=600) |
| 55 | +c['change_source'] = [ poller ] |
| 56 | + |
| 57 | +# For example, if you had CVSToys installed on your repository, and your |
| 58 | +# CVSROOT/freshcfg file had an entry like this: |
| 59 | +#pb = ConfigurationSet([ |
| 60 | +# (None, None, None, PBService(userpass=('foo', 'bar'), port=4519)), |
| 61 | +# ]) |
| 62 | + |
| 63 | +# then you could use the following buildmaster Change Source to subscribe to |
| 64 | +# the FreshCVS daemon and be notified on every commit: |
| 65 | +# |
| 66 | +#from buildbot.changes.freshcvs import FreshCVSSource |
| 67 | +#fc_source = FreshCVSSource("cvs.example.com", 4519, "foo", "bar") |
| 68 | +#c['change_source'] = fc_source |
| 69 | + |
| 70 | +# or, use a PBChangeSource, and then have your repository's commit script run |
| 71 | +# 'buildbot sendchange', or use contrib/svn_buildbot.py, or |
| 72 | +# contrib/arch_buildbot.py : |
| 73 | +# |
| 74 | +#from buildbot.changes.pb import PBChangeSource |
| 75 | +#c['change_source'] = PBChangeSource() |
| 76 | + |
| 77 | +# If you wat to use SVNPoller, it might look something like |
| 78 | +# # Where to get source code changes |
| 79 | +# from buildbot.changes.svnpoller import SVNPoller |
| 80 | +# source_code_svn_url='https://svn.myproject.org/bluejay/trunk' |
| 81 | +# svn_poller = SVNPoller( |
| 82 | +# svnurl=source_code_svn_url, |
| 83 | +# pollinterval=60*60, # seconds |
| 84 | +# histmax=10, |
| 85 | +# svnbin='/usr/bin/svn', |
| 86 | +## ) |
| 87 | +# c['change_source'] = [ svn_poller ] |
| 88 | + |
| 89 | +####### SCHEDULERS |
| 90 | + |
| 91 | +## configure the Schedulers |
| 92 | + |
| 93 | +from buildbot.scheduler import Scheduler |
| 94 | +c['schedulers'] = [] |
| 95 | +for py_ver in PYTHON_VERSIONS: |
| 96 | + c['schedulers'].append( |
| 97 | + Scheduler(name="py%s" % py_ver, branch=None, |
| 98 | + treeStableTimer=2*60, |
| 99 | + builderNames=["builder-%s" % py_ver])) |
| 100 | + |
| 101 | + |
| 102 | +####### BUILDERS |
| 103 | + |
| 104 | +# the 'builders' list defines the Builders. Each one is configured with a |
| 105 | +# dictionary, using the following keys: |
| 106 | +# name (required): the name used to describe this builder |
| 107 | +# slavename or slavenames (required): which slave(s) to use (must appear in c['slaves']) |
| 108 | +# factory (required): a BuildFactory to define how the build is run |
| 109 | +# builddir (optional): which subdirectory to run the builder in |
| 110 | + |
| 111 | +# buildbot/process/factory.py provides several BuildFactory classes you can |
| 112 | +# start with, which implement build processes for common targets (GNU |
| 113 | +# autoconf projects, CPAN perl modules, etc). The factory.BuildFactory is the |
| 114 | +# base class, and is configured with a series of BuildSteps. When the build |
| 115 | +# is run, the appropriate buildslave is told to execute each Step in turn. |
| 116 | + |
| 117 | +# the first BuildStep is typically responsible for obtaining a copy of the |
| 118 | +# sources. There are source-obtaining Steps in buildbot/steps/source.py for |
| 119 | +# CVS, SVN, and others. |
| 120 | + |
| 121 | +cvsroot = ":pserver:[email protected]:/cvsroot/buildbot" |
| 122 | +cvsmodule = "buildbot" |
| 123 | + |
| 124 | +from buildbot.process import factory |
| 125 | +from buildbot.steps.source import CVS, Mercurial |
| 126 | +from buildbot.steps.shell import Compile, ShellCommand |
| 127 | +from buildbot.steps.python_twisted import Trial |
| 128 | +f1 = factory.BuildFactory() |
| 129 | +f1.addStep(CVS(cvsroot=cvsroot, cvsmodule=cvsmodule, login="", mode="copy")) |
| 130 | +f1.addStep(Compile(command=["python", "./setup.py", "build"])) |
| 131 | +f1.addStep(Trial(testChanges=True, testpath=".")) |
| 132 | + |
| 133 | +from buildbot.config import BuilderConfig |
| 134 | + |
| 135 | +def _mk_factory(py_ver): |
| 136 | + py_bin = "/home/build/python/python%(ver)s/bin/python%(ver)s" % {"ver": py_ver} |
| 137 | + py2to3 = "/home/build/python/python%(ver)s/bin/2to3" % {"ver": py_ver} |
| 138 | + site_pkgs = "/home/build/python/python%(ver)s/lib/site-packages/sqlparse" % {"ver": py_ver} |
| 139 | + is_py3k = bool(py_ver.startswith("3")) |
| 140 | + workdir = "build/" |
| 141 | + f = factory.BuildFactory() |
| 142 | + f.addStep(Mercurial(repourl="http://python-sqlparse.googlecode.com/hg/")) |
| 143 | + f.addStep(ShellCommand(command=["rm", "-rf", site_pkgs], |
| 144 | + description="removing installed package", |
| 145 | + descriptionDone="site-pkgs clean")) |
| 146 | + if is_py3k: |
| 147 | + workdir = "build/extras/py3k/" |
| 148 | + f.addStep(ShellCommand(command=["make", "clean"], |
| 149 | + workdir=workdir, |
| 150 | + description="cleaning up", |
| 151 | + descriptionDone="cleaned up")) |
| 152 | + f.addStep(ShellCommand(command=["make", "2TO3=%s" % py2to3], |
| 153 | + workdir=workdir, |
| 154 | + description="creating py3 version", |
| 155 | + descriptionDone="py3 version created")) |
| 156 | + f.addStep(Compile(command=[py_bin, "setup.py", "build"], |
| 157 | + workdir=workdir)) |
| 158 | + f.addStep(ShellCommand(command=[py_bin, "setup.py", "install"], |
| 159 | + description="installing module", |
| 160 | + descriptionDone="module installed", |
| 161 | + workdir=workdir)) |
| 162 | + f.addStep(ShellCommand(command=["mv", "sqlparse", "_sqlparse"], |
| 163 | + description="moving local module", |
| 164 | + descriptionDone="local module moved", |
| 165 | + workdir=workdir)) |
| 166 | + f.addStep(ShellCommand(command=[py_bin, "tests/run_tests.py"], |
| 167 | + description="running tests", |
| 168 | + descriptionDone="tests done", |
| 169 | + workdir=workdir)) |
| 170 | + f.addStep(ShellCommand(command=["mv", "_sqlparse", "sqlparse"], |
| 171 | + description="restoring local module", |
| 172 | + descriptionDone="local module restored", |
| 173 | + workdir=workdir)) |
| 174 | + return f |
| 175 | + |
| 176 | +def _mk_builder(py_ver): |
| 177 | + return BuilderConfig( |
| 178 | + name="builder-%s" % py_ver, |
| 179 | + slavename="bot1linux", |
| 180 | + builddir="full-%s" % py_ver, |
| 181 | + factory=_mk_factory(py_ver)) |
| 182 | + |
| 183 | +c['builders'] = [] |
| 184 | +for py_ver in PYTHON_VERSIONS: |
| 185 | + c['builders'].append(_mk_builder(py_ver)) |
| 186 | + |
| 187 | + |
| 188 | +####### STATUS TARGETS |
| 189 | + |
| 190 | +# 'status' is a list of Status Targets. The results of each build will be |
| 191 | +# pushed to these targets. buildbot/status/*.py has a variety to choose from, |
| 192 | +# including web pages, email senders, and IRC bots. |
| 193 | + |
| 194 | +c['status'] = [] |
| 195 | + |
| 196 | +from buildbot.status import html |
| 197 | +from buildbot.status.web import auth, authz |
| 198 | +authz_cfg=authz.Authz( |
| 199 | + # change any of these to True to enable; see the manual for more |
| 200 | + # options |
| 201 | + gracefulShutdown = False, |
| 202 | + forceBuild = True, |
| 203 | + forceAllBuilds = True, |
| 204 | + pingBuilder = True, |
| 205 | + stopBuild = False, |
| 206 | + stopAllBuilds = False, |
| 207 | + cancelPendingBuild = True, |
| 208 | +) |
| 209 | +c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg)) |
| 210 | + |
| 211 | +from buildbot.status import mail |
| 212 | +c['status'].append(mail.MailNotifier( |
| 213 | + |
| 214 | + extraRecipients=[ "[email protected]"], |
| 215 | + sendToInterestedUsers=False, |
| 216 | + mode="failing")) |
| 217 | +# |
| 218 | +# from buildbot.status import words |
| 219 | +# c['status'].append(words.IRC(host="irc.example.com", nick="bb", |
| 220 | +# channels=["#example"])) |
| 221 | +# c['status'].append(words.IRC(host="irc.example.com", nick="bb", |
| 222 | +# channels=["#example"], useSSL=True)) |
| 223 | +# |
| 224 | +# from buildbot.status import client |
| 225 | +# c['status'].append(client.PBListener(9988)) |
| 226 | + |
| 227 | + |
| 228 | +####### DEBUGGING OPTIONS |
| 229 | + |
| 230 | +# if you set 'debugPassword', then you can connect to the buildmaster with |
| 231 | +# the diagnostic tool in contrib/debugclient.py . From this tool, you can |
| 232 | +# manually force builds and inject changes, which may be useful for testing |
| 233 | +# your buildmaster without actually committing changes to your repository (or |
| 234 | +# before you have a functioning 'sources' set up). The debug tool uses the |
| 235 | +# same port number as the slaves do: 'slavePortnum'. |
| 236 | + |
| 237 | +#c['debugPassword'] = "debugpassword" |
| 238 | + |
| 239 | +# if you set 'manhole', you can ssh into the buildmaster and get an |
| 240 | +# interactive python shell, which may be useful for debugging buildbot |
| 241 | +# internals. It is probably only useful for buildbot developers. You can also |
| 242 | +# use an authorized_keys file, or plain telnet. |
| 243 | +#from buildbot import manhole |
| 244 | +#c['manhole'] = manhole.PasswordManhole("tcp:9999:interface=127.0.0.1", |
| 245 | +# "admin", "password") |
| 246 | + |
| 247 | + |
| 248 | +####### PROJECT IDENTITY |
| 249 | + |
| 250 | +# the 'projectName' string will be used to describe the project that this |
| 251 | +# buildbot is working on. For example, it is used as the title of the |
| 252 | +# waterfall HTML page. The 'projectURL' string will be used to provide a link |
| 253 | +# from buildbot HTML pages to your project's home page. |
| 254 | + |
| 255 | +c['projectName'] = "python-sqlparse" |
| 256 | +c['projectURL'] = "http://python-sqlparse.googlecode.com" |
| 257 | + |
| 258 | +# the 'buildbotURL' string should point to the location where the buildbot's |
| 259 | +# internal web server (usually the html.WebStatus page) is visible. This |
| 260 | +# typically uses the port number set in the Waterfall 'status' entry, but |
| 261 | +# with an externally-visible host name which the buildbot cannot figure out |
| 262 | +# without some help. |
| 263 | + |
| 264 | +c['buildbotURL'] = "http://buildbot.andialbrecht.de" |
0 commit comments