Ticket #1842: master.cfg

File master.cfg, 5.9 KB (added by dabrahams, 2 years ago)
Line 
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.
9c = BuildmasterConfig = {}
10
11####### BUILDSLAVES
12
13# The 'slaves' list defines the set of recognized buildslaves. Each
14# element is a BuildSlave object, specifying a unique slave name and
15# password.  The same slave name and password must be configured on
16# the slave.
17from buildbot.buildslave import BuildSlave
18from slave import passwd
19c['slaves'] = [
20    BuildSlave(name, password)
21    for name,password in passwd.iteritems()
22]
23
24# 'slavePortnum' defines the TCP port to listen on for connections from slaves.
25# This must match the value configured into the buildslaves (with their
26# --master option)
27c['slavePortnum'] = 9989
28
29####### CHANGESOURCES
30
31# the 'change_source' setting tells the buildmaster how it should find out
32# about source code changes. Any class which implements IChangeSource can be
33# put here: there are several in buildbot/changes/*.py to choose from.
34
35# This is the one used for GitHub changes
36from buildbot.changes.pb import PBChangeSource
37c['change_source'] = PBChangeSource()
38
39####### SCHEDULERS
40
41# Configure the Schedulers, which decide how to react to incoming changes.
42from buildbot.scheduler import AnyBranchScheduler
43from buildbot.schedulers.filter import ChangeFilter
44c['schedulers'] = []
45c['schedulers'].append(AnyBranchScheduler(name="scheduler",
46                                 #change_filter=ChangeFilter(project_re=".*", branch_re=".*"),
47                                 treeStableTimer=1,
48                                 builderNames=["el-get-win32"]))
49
50
51####### BUILDERS
52
53# The 'builders' list defines the Builders, which tell Buildbot how to perform a build:
54# what steps, and which slaves can execute them.  Note that any particular build will
55# only take place on one slave.
56
57from buildbot.process import factory
58from buildbot.steps.source import Git
59from buildbot.steps.shell import Test, ShellCommand, SetProperty
60from buildbot.steps.slave import SetPropertiesFromEnv
61from buildbot.process.properties import WithProperties
62import os
63
64class BuildProcedure(factory.BuildFactory):
65    def step(self, s):
66        self.addStep(s)
67        return self
68   
69    def addSteps(self, *steps_):
70        for s in steps_:
71            self.addStep(s)
72        return self
73
74def Emacs():
75    return WithProperties(
76        '%(EMACS)s'
77#, EMACS=lambda props: props.properties.get('EMACS','emacs')
78        )
79
80def EmacsTest(*args, **kw):
81    return Test(
82        command=[Emacs(), '--no-splash', '--debug-init'] + (
83            list(args)
84            + reduce(lambda r, kv: r+['--'+kv[0],kv[1]], kw.items(), [])),
85        env = { 'HOME': WithProperties('%(HOME)s'), 'HOMEPATH': WithProperties('%(HOME)s') },
86        timeout = kw.get('timeout', 20),
87        logfiles = dict(testlog=dict(filename='test.log'))
88        )
89
90class GitHubElisp(BuildProcedure):
91    def __init__(self, repo, *testnames):
92        BuildProcedure.__init__(self)
93        self.addSteps(
94            Git(repourl='git://github.com/%s.git' % repo),
95            SetPropertiesFromEnv(variables=['EMACS']),
96            SetProperty(
97                command=[Emacs(), '--batch', '--eval',
98                         '(princ (make-temp-file "home" t ".bbot"))'],
99                property='HOME'))
100
101        for t in testnames or ['test/test']:
102            self.addStep(EmacsTest(load= t+'.el'))
103
104q1 = {'name': 'el-get-win32',
105      'slavename': 'Win03d',
106      'builddir': 'el-get',
107      'factory': GitHubElisp('dabrahams/el-get.git')
108      }
109
110c['builders'] = [q1]
111
112####### STATUS TARGETS
113
114# 'status' is a list of Status Targets. The results of each build will be
115# pushed to these targets. buildbot/status/*.py has a variety to choose from,
116# including web pages, email senders, and IRC bots.
117
118c['status'] = []
119
120from buildbot.status.web import auth, authz
121
122authz_cfg=authz.Authz(
123    # change any of these to True to enable; see the manual for more
124    # options
125    gracefulShutdown = True,
126    forceBuild = True,
127    forceAllBuilds = True,
128    pingBuilder = True,
129    stopBuild = True,
130    stopAllBuilds = True,
131    cancelPendingBuild = True,
132)
133
134from buildbot.status import words
135c['status'].append(words.IRC(host="irc.freenode.net", nick="elgetbot",
136                                notify_events={
137                                        'successToFailure' : 1,
138                                        'failureToSuccess' : 1,
139                                },
140                              channels=["#el-get"]))
141
142from buildbot.status import html
143c['status'].append(html.WebStatus(
144        http_port=8010, authz=authz_cfg,
145        order_console_by_time=True,
146        revlink="http://github.com/dabrahams/el-get/commit/%s",
147        change_hook_dialects={ 'github' : True },
148        ))
149
150from buildbot.status import mail
151c['status'].append(mail.MailNotifier(fromaddr="buildbot@boostpro.com",
152                                      extraRecipients=["el-get-devel@tapoueh.org"],
153                                      sendToInterestedUsers=True))
154
155####### PROJECT IDENTITY
156
157# the 'projectName' string will be used to describe the project that this
158# buildbot is working on. For example, it is used as the title of the
159# waterfall HTML page. The 'projectURL' string will be used to provide a link
160# from buildbot HTML pages to your project's home page.
161
162c['projectName'] = "BoostPro"
163c['projectURL'] = "http://boostpro.com"
164
165# the 'buildbotURL' string should point to the location where the buildbot's
166# internal web server (usually the html.WebStatus page) is visible. This
167# typically uses the port number set in the Waterfall 'status' entry, but
168# with an externally-visible host name which the buildbot cannot figure out
169# without some help.
170
171c['buildbotURL'] = "http://bbot.boostpro.com:8010/"
172
173####### DB URL
174
175# This specifies what database buildbot uses to store change and scheduler
176# state.  You can leave this at its default for all but the largest
177# installations.
178c['db_url'] = "sqlite:///state.sqlite"
179