root/branches/mk/support/master.cfg

Revision 138, 7.6 kB (checked in by mk, 7 years ago)

Added build egg_info step to buildbot setup to stop "Module cheesecake was already imported" warnings.

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 (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 import os.path
13 from buildbot.changes.freshcvs import FreshCVSSource
14 from buildbot.scheduler import Scheduler, Periodic, Nightly
15 from buildbot.process import step, factory
16 from buildbot.status import html
17 s = factory.s
18
19 import secret
20
21 # This is the dictionary that the buildmaster pays attention to. We also use
22 # a shorter alias to save typing.
23 c = BuildmasterConfig = {}
24
25 # the 'bots' list defines the set of allowable buildslaves. Each element is a
26 # tuple of bot-name and bot-password. These correspond to values given to the
27 # buildslave's mktap invocation.
28 c['bots'] = [("soc_x86_rh9", secret.password)]
29
30
31 # the 'sources' list tells the buildmaster how it should find out about
32 # source code changes. Any class which implements IChangeSource can be added
33 # to this list: there are several in buildbot/changes/*.py to choose from.
34
35 c['sources'] = []
36
37 # For example, if you had CVSToys installed on your repository, and your
38 # CVSROOT/freshcfg file had an entry like this:
39 #pb = ConfigurationSet([
40 #    (None, None, None, PBService(userpass=('foo', 'bar'), port=4519)),
41 #    ])
42
43 # then you could use the following buildmaster Change Source to subscribe to
44 # the FreshCVS daemon and be notified on every commit:
45 #
46 #fc_source = FreshCVSSource("cvs.example.com", 4519, "foo", "bar")
47 #c['sources'].append(fc_source)
48
49 # or, use a PBChangeSource, and then have your repository's commit script run
50 # 'buildbot sendchange', or contrib/svn_buildbot.py, or
51 # contrib/arch_buildbot.py :
52 #
53 #from buildbot.changes.pb import PBChangeSource
54 #c['sources'].append(PBChangeSource())
55
56
57 ## configure the Schedulers
58
59 c['schedulers'] = [
60     Nightly("every_6_hours", ["x86_rh9_trunk"], hour=[9,15,21,3], minute=0),
61     Nightly("every_6_hours+10min", ["x86_rh9_mk"], hour=[9,15,21,3], minute=10),
62 ]
63
64
65 # the 'builders' list defines the Builders. Each one is configured with a
66 # dictionary, using the following keys:
67 #  name (required): the name used to describe this bilder
68 #  slavename (required): which slave to use, must appear in c['bots']
69 #  builddir (required): which subdirectory to run the builder in
70 #  factory (required): a BuildFactory to define how the build is run
71 #  periodicBuildTime (optional): if set, force a build every N seconds
72
73 # buildbot/process/factory.py provides several BuildFactory classes you can
74 # start with, which implement build processes for common targets (GNU
75 # autoconf projects, CPAN perl modules, etc). The factory.BuildFactory is the
76 # base class, and is configured with a series of BuildSteps. When the build
77 # is run, the appropriate buildslave is told to execute each Step in turn.
78
79 # the first BuildStep is typically responsible for obtaining a copy of the
80 # sources. There are source-obtaining Steps in buildbot/process/step.py for
81 # CVS, SVN, and others.
82
83 make_source = lambda branch: s(step.SVN, mode='update',
84                 baseURL='http://svn.pycheesecake.org/',
85                 defaultBranch=branch)
86
87 source_mk = make_source('branches/mk/')
88 source_trunk = make_source('trunk')
89
90 class StepBuildEggInfo(step.ShellCommand):
91     name = "build egg info"
92     description = ["building egg info"]
93     descriptionDone = [name]
94
95 build_egg_info = s(StepBuildEggInfo, command="python setup.py egg_info")
96
97 class StepUnitTest(step.ShellCommand):
98     name = "unit tests"
99     description = ["running unit tests"]
100     descriptionDone = [name]
101
102 unit_tests = s(StepUnitTest, command="nosetests --exe --with-doctest --doctest-tests --with-coverage --verbose --include unit")
103
104 class StepFunctionalTest(step.ShellCommand):
105     name = "functional tests"
106     description = ["running functional tests"]
107     descriptionDone = [name]
108
109 functional_tests = s(StepFunctionalTest, command="nosetests --verbose --include functional")
110
111 class EpyDocBuild(step.ShellCommand):
112     name = "documentation"
113     description = ["building documentation"]
114     descriptionDone = [name]
115
116 epydoc_build = lambda doc_dest: s(EpyDocBuild,
117                  command="/bin/sh support/generate_docs.sh %s" % doc_dest)
118
119 class CoverageBuild(step.ShellCommand):
120     name = "coverage"
121     description = ["building coverage statistics"]
122     descriptionDone = [name]
123
124 coverage_build = lambda doc_dest: s(CoverageBuild,
125                    command="/bin/sh support/generate_coverage.sh %s" % doc_dest)
126
127 make_factory = lambda source, doc_dest: factory.BuildFactory([
128                     source,
129                     build_egg_info,
130                     unit_tests,
131                     functional_tests,
132                     epydoc_build(doc_dest),
133                     coverage_build(doc_dest)])
134
135 f_mk = make_factory(source_mk, "/var/www/agilistas/cheesecake/mk")
136 f_trunk = make_factory(source_trunk, "/var/www/agilistas/cheesecake/trunk")
137
138 c['builders'] = [
139     {'name': 'x86_rh9_trunk',
140     'slavename': 'soc_x86_rh9',
141     'builddir': 'test-trunk',
142     'factory': f_trunk
143     },
144     {'name':'x86_rh9_mk',
145     'slavename':'soc_x86_rh9',
146     'builddir':'test-mk',
147     'factory':f_mk
148     },
149 ]
150
151 # 'slavePortnum' defines the TCP port to listen on. This must match the value
152 # configured into the buildslaves (with their --master option)
153
154 c['slavePortnum'] = secret.port
155
156 # 'status' is a list of Status Targets. The results of each build will be
157 # pushed to these targets. buildbot/status/*.py has a variety to choose from,
158 # including web pages, email senders, and IRC bots.
159
160 c['status'] = []
161 c['status'].append(html.Waterfall(http_port=8888))
162
163 # from buildbot.status import mail
164 # c['status'].append(mail.MailNotifier(fromaddr="buildbot@localhost",
165 #                                      extraRecipients=["builds@example.com"],
166 #                                      sendToInterestedUsers=False))
167 # from buildbot.status import words
168 # c['status'].append(words.IRC(host="irc.example.com", nick="bb",
169 #                              channels=["#example"]))
170
171
172 # if you set 'debugPassword', then you can connect to the buildmaster with
173 # the diagnostic tool in contrib/debugclient.py . From this tool, you can
174 # manually force builds and inject changes, which may be useful for testing
175 # your buildmaster without actually commiting changes to your repository (or
176 # before you have a functioning 'sources' set up). The debug tool uses the
177 # same port number as the slaves do: 'slavePortnum'.
178
179 #c['debugPassword'] = "debugpassword"
180
181 # if you set 'manhole', you can telnet into the buildmaster and get an
182 # interactive python shell, which may be useful for debugging buildbot
183 # internals. It is probably only useful for buildbot developers.
184 #from buildbot.master import Manhole
185 #c['manhole'] = Manhole(9999, "admin", "password")
186
187 # the 'projectName' string will be used to describe the project that this
188 # buildbot is working on. For example, it is used as the title of the
189 # waterfall HTML page. The 'projectURL' string will be used to provide a link
190 # from buildbot HTML pages to your project's home page.
191
192 c['projectName'] = "Cheesecake"
193 c['projectURL'] = "http://pycheesecake.org/"
194
195 # the 'buildbotURL' string should point to the location where the buildbot's
196 # internal web server (usually the html.Waterfall page) is visible. This
197 # typically uses the port number set in the Waterfall 'status' entry, but
198 # with an externally-visible host name which the buildbot cannot figure out
199 # without some help.
200
201 c['buildbotURL'] = "http://agilistas.org:8888"
Note: See TracBrowser for help on using the browser.