comparison README.txt @ 208:2d5b78d3411c

explain how sources work
author Jeff Hammel <jhammel@mozilla.com>
date Fri, 04 Feb 2011 17:14:46 -0800
parents 3e5d1c1e302d
children 98e3594f2928
comparison
equal deleted inserted replaced
207:dc56c0de73bc 208:2d5b78d3411c
179 ``autobot.projects`` (use 179 ``autobot.projects`` (use
180 ``python -c 'from autobot import projects; print projects.__file__'`` 180 ``python -c 'from autobot import projects; print projects.__file__'``
181 to see this location). 181 to see this location).
182 182
183 183
184 Sources
185 -------
186
187 ``autobot.process.factory:SourceFactory`` is an abstract base class
188 for specifying sources. Sources live as a member on the instance, named
189 (oddly) ``sources``. This is a dict with the key being the source
190 type and the value being the source to use. Source types are
191 currently "git" and "hg", though this is easily extensible.
192
193 Internally, an individual source is stored as a 2-tuple with the first
194 item being the URL of the source and the second item being the
195 branch. If the branch is ``None`` or not specified, this is assumed
196 to equate to ``master`` for git or ``default`` for hg. However, you
197 may also use a string in the form of ``URL#branch``. In addition, you
198 may specify a whitespace separated source, which ``SourceFactory``
199 will split into a list of sources. So all of these translate into the
200 same source::
201
202 sources = {'hg': 'http://hg.mozilla.org/automation/logparser'}
203
204 sources = {'hg': ['http://hg.mozilla.org/automation/logparser#default']}
205
206 sources = {'hg': [('http://hg.mozilla.org/automation/logparser', None)]
207
208 The generated ``master.cfg`` polls for changes on the given source,
209 then uses ``buildbot.schedulers.filter:Changefilter`` in conjunction
210 with a ``Scheduler`` to trigger the appropriate builds.
211
212 While, in general, the canonical sources should be specified at the
213 class level, if an appropriate argument (e.g. *hg* or *git*) is passed
214 in to the ``SourceFactory`` constructor, this will override that
215 source type. This is useful for testing changes on non-canonical URLs
216 and/or branches.
217
184 218
185 Adding a New Project 219 Adding a New Project
186 -------------------- 220 --------------------
187 221
188 Occassionally, you'll need to add a new project to test. You can add 222 Occassionally, you'll need to add a new project to test. You can add