|
| 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 | + |
| 13 | +# This is the dictionary that the buildmaster pays attention to. We also use |
| 14 | +# a shorter alias to save typing. |
| 15 | +c = BuildmasterConfig = {} |
| 16 | + |
| 17 | +####### BUILDSLAVES |
| 18 | + |
| 19 | +# the 'bots' list defines the set of allowable buildslaves. Each element is a |
| 20 | +# tuple of bot-name and bot-password. These correspond to values given to the |
| 21 | +# buildslave's mktap invocation. |
| 22 | +c['bots'] = [("merlot", "U-Xmpr"), |
| 23 | + ] |
| 24 | + |
| 25 | + |
| 26 | +# 'slavePortnum' defines the TCP port to listen on. This must match the value |
| 27 | +# configured into the buildslaves (with their --master option) |
| 28 | + |
| 29 | +c['slavePortnum'] = 2718 |
| 30 | + |
| 31 | + |
| 32 | +####### CHANGESOURCES |
| 33 | + |
| 34 | +# the 'sources' list tells the buildmaster how it should find out about |
| 35 | +# source code changes. Any class which implements IChangeSource can be added |
| 36 | +# to this list: there are several in buildbot/changes/*.py to choose from. |
| 37 | + |
| 38 | +c['sources'] = [] |
| 39 | + |
| 40 | +# For example, if you had CVSToys installed on your repository, and your |
| 41 | +# CVSROOT/freshcfg file had an entry like this: |
| 42 | +#pb = ConfigurationSet([ |
| 43 | +# (None, None, None, PBService(userpass=('foo', 'bar'), port=4519)), |
| 44 | +# ]) |
| 45 | + |
| 46 | +# then you could use the following buildmaster Change Source to subscribe to |
| 47 | +# the FreshCVS daemon and be notified on every commit: |
| 48 | +# |
| 49 | +#from buildbot.changes.freshcvs import FreshCVSSource |
| 50 | +#fc_source = FreshCVSSource("cvs.example.com", 4519, "foo", "bar") |
| 51 | +#c['sources'].append(fc_source) |
| 52 | + |
| 53 | +# or, use a PBChangeSource, and then have your repository's commit script run |
| 54 | +# 'buildbot sendchange', or contrib/svn_buildbot.py, or |
| 55 | +# contrib/arch_buildbot.py : |
| 56 | +# |
| 57 | +from buildbot.changes.pb import PBChangeSource |
| 58 | +c['sources'].append(PBChangeSource()) |
| 59 | + |
| 60 | + |
| 61 | +####### SCHEDULERS |
| 62 | + |
| 63 | +## configure the Schedulers |
| 64 | + |
| 65 | +from buildbot.scheduler import Scheduler |
| 66 | +c['schedulers'] = [] |
| 67 | +c['schedulers'].append(Scheduler(name="all", branch=None, |
| 68 | + treeStableTimer=2*60, |
| 69 | + builderNames=["merlot-builder-1"])) |
| 70 | + |
| 71 | + |
| 72 | +####### BUILDERS |
| 73 | + |
| 74 | +# the 'builders' list defines the Builders. Each one is configured with a |
| 75 | +# dictionary, using the following keys: |
| 76 | +# name (required): the name used to describe this bilder |
| 77 | +# slavename (required): which slave to use, must appear in c['bots'] |
| 78 | +# builddir (required): which subdirectory to run the builder in |
| 79 | +# factory (required): a BuildFactory to define how the build is run |
| 80 | +# periodicBuildTime (optional): if set, force a build every N seconds |
| 81 | + |
| 82 | +# buildbot/process/factory.py provides several BuildFactory classes you can |
| 83 | +# start with, which implement build processes for common targets (GNU |
| 84 | +# autoconf projects, CPAN perl modules, etc). The factory.BuildFactory is the |
| 85 | +# base class, and is configured with a series of BuildSteps. When the build |
| 86 | +# is run, the appropriate buildslave is told to execute each Step in turn. |
| 87 | + |
| 88 | +# the first BuildStep is typically responsible for obtaining a copy of the |
| 89 | +# sources. There are source-obtaining Steps in buildbot/process/step.py for |
| 90 | +# CVS, SVN, and others. |
| 91 | + |
| 92 | +from buildbot.process import factory |
| 93 | +from buildbot.steps.source import SVN |
| 94 | +from buildbot.steps.dummy import Dummy |
| 95 | +from buildbot.steps.python import PyFlakes |
| 96 | +from buildbot.steps.shell import ShellCommand as BaseShellCommand |
| 97 | +from buildbot.status.builder import SUCCESS, WARNINGS, FAILURE |
| 98 | + |
| 99 | +class ShellCommand(BaseShellCommand): |
| 100 | + def evaluateCommand(self, cmd): |
| 101 | + if cmd.rc == 0: |
| 102 | + return SUCCESS |
| 103 | + if cmd.rc == 1: |
| 104 | + return WARNINGS |
| 105 | + else: |
| 106 | + return FAILURE |
| 107 | + |
| 108 | +f1 = factory.BuildFactory() |
| 109 | +f1.addStep(SVN, svnurl="http://svn.tools.ietf.org/svn/tools/ietfdb/trunk/", username="buildbot@tools.ietf.org", password="U64#GUxr") |
| 110 | +f1.addStep(ShellCommand, command=["test/test-setup"]) |
| 111 | +f1.addStep(PyFlakes, command=["pyflakes", "ietf"], warnOnFailure=True) |
| 112 | +f1.addStep(ShellCommand, command=["python", "ietf/manage.py", "test"], env={'PYTHONPATH': ["test/lib",]} ) |
| 113 | +f1.addStep(ShellCommand, command=["test/test-teardown"]) |
| 114 | +f1.addStep(Dummy, timeout=10) |
| 115 | + |
| 116 | +b1 = {'name': "merlot-builder-1", |
| 117 | + 'slavename': "merlot", |
| 118 | + 'builddir': "builder1", |
| 119 | + 'factory': f1, |
| 120 | + } |
| 121 | +c['builders'] = [b1] |
| 122 | + |
| 123 | + |
| 124 | +####### STATUS TARGETS |
| 125 | + |
| 126 | +# 'status' is a list of Status Targets. The results of each build will be |
| 127 | +# pushed to these targets. buildbot/status/*.py has a variety to choose from, |
| 128 | +# including web pages, email senders, and IRC bots. |
| 129 | + |
| 130 | +c['status'] = [] |
| 131 | + |
| 132 | +#from buildbot.status import html |
| 133 | +#c['status'].append(html.Waterfall(http_port=8010)) |
| 134 | + |
| 135 | +import trac_buildbot_html as trac_html |
| 136 | +c['status'].append(trac_html.Waterfall(http_port=8010)) |
| 137 | + |
| 138 | +import trac_buildbot_html_dev as trac_html_dev |
| 139 | +c['status'].append(trac_html_dev.Waterfall(http_port=8011)) |
| 140 | + |
| 141 | +# from buildbot.status import mail |
| 142 | +# c['status'].append(mail.MailNotifier(fromaddr="buildbot@tools.ietf.org", |
| 143 | +# extraRecipients=["django-project@ietf.org"], |
| 144 | +# mode="problem", |
| 145 | +# mode="failing", |
| 146 | +# sendToInterestedUsers=True)) |
| 147 | + |
| 148 | +# from buildbot.status import words |
| 149 | +# c['status'].append(words.IRC(host="irc.example.com", nick="bb", |
| 150 | +# channels=["#example"])) |
| 151 | +# |
| 152 | +# from buildbot.status import client |
| 153 | +# c['status'].append(client.PBListener(9988)) |
| 154 | + |
| 155 | + |
| 156 | +####### DEBUGGING OPTIONS |
| 157 | + |
| 158 | +# if you set 'debugPassword', then you can connect to the buildmaster with |
| 159 | +# the diagnostic tool in contrib/debugclient.py . From this tool, you can |
| 160 | +# manually force builds and inject changes, which may be useful for testing |
| 161 | +# your buildmaster without actually commiting changes to your repository (or |
| 162 | +# before you have a functioning 'sources' set up). The debug tool uses the |
| 163 | +# same port number as the slaves do: 'slavePortnum'. |
| 164 | + |
| 165 | +#c['debugPassword'] = "debugpassword" |
| 166 | + |
| 167 | +# if you set 'manhole', you can ssh into the buildmaster and get an |
| 168 | +# interactive python shell, which may be useful for debugging buildbot |
| 169 | +# internals. It is probably only useful for buildbot developers. You can also |
| 170 | +# use an authorized_keys file, or plain telnet. |
| 171 | +#from buildbot import manhole |
| 172 | +#c['manhole'] = manhole.PasswordManhole("tcp:9999:interface=127.0.0.1", |
| 173 | +# "admin", "password") |
| 174 | + |
| 175 | + |
| 176 | +####### PROJECT IDENTITY |
| 177 | + |
| 178 | +# the 'projectName' string will be used to describe the project that this |
| 179 | +# buildbot is working on. For example, it is used as the title of the |
| 180 | +# waterfall HTML page. The 'projectURL' string will be used to provide a link |
| 181 | +# from buildbot HTML pages to your project's home page. |
| 182 | + |
| 183 | +c['projectName'] = "IETFdb" |
| 184 | +c['projectURL'] = "http://merlot.tools.ietf.org/tools/ietfdb/" |
| 185 | + |
| 186 | +# the 'buildbotURL' string should point to the location where the buildbot's |
| 187 | +# internal web server (usually the html.Waterfall page) is visible. This |
| 188 | +# typically uses the port number set in the Waterfall 'status' entry, but |
| 189 | +# with an externally-visible host name which the buildbot cannot figure out |
| 190 | +# without some help. |
| 191 | + |
| 192 | +c['buildbotURL'] = "http://merlot.tools.ietf.org:8010/" |
0 commit comments