tools/buildbot/master.cfg
author Dr!fter
Wed Jul 10 20:33:21 2013 -0400 (2013-07-10)
changeset 3940 b96b670e5232
parent 2269 a0b54dcc11f9
permissions -rw-r--r--
Update TF2 Reload Offset
     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 'slaves' list defines the set of allowable buildslaves. Each element is
    20 # a tuple of bot-name and bot-password. These correspond to values given to
    21 # the buildslave's mktap invocation.
    22 from buildbot.buildslave import BuildSlave
    23 c['slaves'] = [
    24                 BuildSlave("linux",     "***"),
    25                 BuildSlave("win32",     "***")
    26               ]
    27 	
    28 
    29 # to limit to two concurrent builds on a slave, use
    30 #  c['slaves'] = [BuildSlave("bot1name", "bot1passwd", max_builds=2)]
    31 
    32 
    33 # 'slavePortnum' defines the TCP port to listen on. This must match the value
    34 # configured into the buildslaves (with their --master option)
    35 
    36 c['slavePortnum'] = 0000
    37 
    38 ####### CHANGESOURCES
    39 
    40 # the 'change_source' setting tells the buildmaster how it should find out
    41 # about source code changes. Any class which implements IChangeSource can be
    42 # put here: there are several in buildbot/changes/*.py to choose from.
    43 
    44 from buildbot.changes.pb import PBChangeSource
    45 c['change_source'] = PBChangeSource()
    46 
    47 # For example, if you had CVSToys installed on your repository, and your
    48 # CVSROOT/freshcfg file had an entry like this:
    49 #pb = ConfigurationSet([
    50 #    (None, None, None, PBService(userpass=('foo', 'bar'), port=4519)),
    51 #    ])
    52 
    53 # then you could use the following buildmaster Change Source to subscribe to
    54 # the FreshCVS daemon and be notified on every commit:
    55 #
    56 #from buildbot.changes.freshcvs import FreshCVSSource
    57 #fc_source = FreshCVSSource("cvs.example.com", 4519, "foo", "bar")
    58 #c['change_source'] = fc_source
    59 
    60 # or, use a PBChangeSource, and then have your repository's commit script run
    61 # 'buildbot sendchange', or use contrib/svn_buildbot.py, or
    62 # contrib/arch_buildbot.py :
    63 #
    64 #from buildbot.changes.pb import PBChangeSource
    65 #c['change_source'] = PBChangeSource()
    66 
    67 
    68 ####### SCHEDULERS
    69 
    70 ## configure the Schedulers
    71 
    72 from buildbot.scheduler import Scheduler
    73 
    74 schedTrunk = Scheduler(
    75         name            = "1.1-trunk",
    76         branch          = "trunk",
    77         treeStableTimer = 1*60,
    78         builderNames    = ["linux-trunk", "win32-trunk"]
    79         )
    80 schedStable = Scheduler(
    81         name            = "1.0-stable",
    82         branch          = "branches/sourcemod-1.0.x",
    83         treeStableTimer = 1*60,
    84         builderNames    = ["linux-stable", "win32-stable"]
    85         )
    86 
    87 c['schedulers'] = [schedStable, schedTrunk]
    88 
    89 
    90 ####### BUILDERS
    91 
    92 # the 'builders' list defines the Builders. Each one is configured with a
    93 # dictionary, using the following keys:
    94 #  name (required): the name used to describe this bilder
    95 #  slavename (required): which slave to use, must appear in c['bots']
    96 #  builddir (required): which subdirectory to run the builder in
    97 #  factory (required): a BuildFactory to define how the build is run
    98 #  periodicBuildTime (optional): if set, force a build every N seconds
    99 
   100 # buildbot/process/factory.py provides several BuildFactory classes you can
   101 # start with, which implement build processes for common targets (GNU
   102 # autoconf projects, CPAN perl modules, etc). The factory.BuildFactory is the
   103 # base class, and is configured with a series of BuildSteps. When the build
   104 # is run, the appropriate buildslave is told to execute each Step in turn.
   105 
   106 # the first BuildStep is typically responsible for obtaining a copy of the
   107 # sources. There are source-obtaining Steps in buildbot/steps/source.py for
   108 # CVS, SVN, and others.
   109 
   110 from buildbot.process import factory
   111 from buildbot.steps.shell import Compile
   112 from buildbot.steps.shell import ShellCommand
   113 from buildbot.steps.transfer import FileDownload
   114 from buildbot.steps.source import SVN
   115 from buildbot.process.properties import WithProperties
   116 from buildbot.steps.python_twisted import Trial
   117 from buildbot import locks
   118 
   119 pdb_lock = locks.MasterLock("symbolstore")
   120 
   121 def create_factory(sep, os):
   122     f1 = factory.BuildFactory()
   123     f1.addStep(SVN(baseURL          = "svn://svn.alliedmods.net/am/sourcemod/",
   124                    mode             = "copy"
   125                   )
   126               )
   127     f1.addStep(ShellCommand(
   128             haltOnFailure           = 1,
   129             name                    = "bootstrap",
   130             command                 = ["tools" + sep + "buildbot" + sep + "bootstrap.pl"],
   131             description             = "bootstrapping",
   132             descriptionDone         = "bootstrapped"
   133             ))
   134     f1.addStep(ShellCommand(
   135             haltOnFailure           = 1,
   136             name                    = "build",
   137             command                 = ["tools" + sep + "buildbot" + sep + "startbuild.pl"],
   138             description             = "compiling",
   139             descriptionDone         = "compiled"
   140             ))
   141     f1.addStep(ShellCommand(
   142             haltOnFailure           = 1,
   143             name                    = "upload",
   144             command                 = ["tools" + sep + "buildbot" + sep + "package.pl", 
   145                                        ".." + sep + ".." + sep + "smdrop_info"
   146                                       ],
   147             description             = "packaging",
   148             descriptionDone         = "uploaded"
   149             ))
   150     if os == "win32":
   151         f1.addStep(ShellCommand(
   152             haltOnFailure           = 1,
   153             locks                   = [pdb_lock],
   154             name                    = "symstore",
   155             command                 = ["tools" + sep + "buildbot" + sep + "symstore.pl"],
   156             description             = "symstore",
   157             descriptionDone         = "symstore"
   158             ))
   159     return f1
   160 
   161 facWin = create_factory("\\", "win32")
   162 facLinux = create_factory("/", "linux")
   163 
   164 buildLinuxStable = {
   165         'name':         'linux-stable',
   166         'slavename':    'linux',
   167         'builddir':     'linux-stable',
   168         'factory':      facLinux
   169       }
   170 buildLinuxTrunk = {
   171         'name':         "linux-trunk",
   172         'slavename':    "linux",
   173         'builddir':     "linux-trunk",
   174         'factory':      facLinux
   175       }
   176 buildWindowsStable = {
   177         'name':         'win32-stable',
   178         'slavename':    'win32',
   179         'builddir':     'win32-stable',
   180         'factory':      facWin
   181       }
   182 buildWindowsTrunk = {
   183         'name':         "win32-trunk",
   184         'slavename':    "win32",
   185         'builddir':     "win32-trunk",
   186         'factory':      facWin
   187       }
   188 c['builders'] = [buildLinuxTrunk, buildWindowsTrunk, buildLinuxStable, buildWindowsStable]
   189 
   190 
   191 ####### STATUS TARGETS
   192 
   193 # 'status' is a list of Status Targets. The results of each build will be
   194 # pushed to these targets. buildbot/status/*.py has a variety to choose from,
   195 # including web pages, email senders, and IRC bots.
   196 
   197 c['status'] = []
   198 
   199 from buildbot.status import html
   200 c['status'].append(html.WebStatus(http_port=8010))
   201 
   202 # from buildbot.status import mail
   203 # c['status'].append(mail.MailNotifier(fromaddr="buildbot@localhost",
   204 #                                      extraRecipients=["[email protected]"],
   205 #                                      sendToInterestedUsers=False))
   206 #
   207 # from buildbot.status import words
   208 # c['status'].append(words.IRC(host="irc.example.com", nick="bb",
   209 #                              channels=["#example"]))
   210 #
   211 # from buildbot.status import client
   212 # c['status'].append(client.PBListener(9988))
   213 
   214 
   215 ####### DEBUGGING OPTIONS
   216 
   217 # if you set 'debugPassword', then you can connect to the buildmaster with
   218 # the diagnostic tool in contrib/debugclient.py . From this tool, you can
   219 # manually force builds and inject changes, which may be useful for testing
   220 # your buildmaster without actually commiting changes to your repository (or
   221 # before you have a functioning 'sources' set up). The debug tool uses the
   222 # same port number as the slaves do: 'slavePortnum'.
   223 
   224 #c['debugPassword'] = "debugpassword"
   225 
   226 # if you set 'manhole', you can ssh into the buildmaster and get an
   227 # interactive python shell, which may be useful for debugging buildbot
   228 # internals. It is probably only useful for buildbot developers. You can also
   229 # use an authorized_keys file, or plain telnet.
   230 #from buildbot import manhole
   231 #c['manhole'] = manhole.PasswordManhole("tcp:9999:interface=127.0.0.1",
   232 #                                       "admin", "password")
   233 
   234 
   235 ####### PROJECT IDENTITY
   236 
   237 # the 'projectName' string will be used to describe the project that this
   238 # buildbot is working on. For example, it is used as the title of the
   239 # waterfall HTML page. The 'projectURL' string will be used to provide a link
   240 # from buildbot HTML pages to your project's home page.
   241 
   242 c['projectName'] = "SourceMod"
   243 c['projectURL'] = "http://www.sourcemod.net/"
   244 
   245 # the 'buildbotURL' string should point to the location where the buildbot's
   246 # internal web server (usually the html.Waterfall page) is visible. This
   247 # typically uses the port number set in the Waterfall 'status' entry, but
   248 # with an externally-visible host name which the buildbot cannot figure out
   249 # without some help.
   250 
   251 c['buildbotURL'] = "http://localhost:8010/"