Buildbot no longer supports Python 2.7 on the Buildbot master.
220.127.116.11. Common Parameters of source checkout operations¶
All source checkout steps accept some common parameters to control how they get the sources and where they should be placed. The remaining per-VC-system parameters are mostly to specify where exactly the sources are coming from.
These two parameters specify the means by which the source is checked out.
modespecifies the type of checkout and
methodtells about the way to implement it.from buildbot.plugins import steps factory = BuildFactory() factory.addStep(steps.Mercurial(repourl='path/to/repo', mode='full', method='fresh'))
modeparameter a string describing the kind of VC operation that is desired, defaulting to
incremental. The options are
Update the source to the desired revision, but do not remove any other files generated by previous builds. This allows compilers to take advantage of object files from previous builds. This mode is exactly same as the old
Update the source, but delete remnants of previous builds. Build steps that follow will need to regenerate all object files.
Methods are specific to the version-control system in question, as they may take advantage of special behaviors in that version-control system that can make checkouts more efficient or reliable.
like all Steps, this indicates the directory where the build will take place. Source Steps are special in that they perform some operations outside of the workdir (like creating the workdir itself).
if True, bypass the usual behavior of checking out the revision in the source stamp, and always update to the latest revision in the repository instead. If the specific VC system supports branches and a specific branch is specified in the step parameters via
defaultBranchparameters then the latest revision on that branch is checked out.
If set, this specifies a tuple of
(delay, repeats)which means that when a full VC checkout fails, it should be retried up to
delayseconds between attempts. If you don’t provide this, it defaults to
None, which means VC operations should not be retried. This is provided to make life easier for workers which are stuck behind poor network connections.
The name of this parameter might vary depending on the Source step you are running. The concept explained here is common to all steps and applies to
repourlas well as for
A common idiom is to pass
Property('repository', 'url://default/repo/path')as repository. This grabs the repository from the source stamp of the build. This can be a security issue, if you allow force builds from the web, or have the
WebStatuschange hooks enabled; as the worker will download code from an arbitrary repository.
This specifies which codebase the source step should use to select the right source stamp. The default codebase value is
''. The codebase must correspond to a codebase assigned by the
codebaseGenerator. If there is no codebaseGenerator defined in the master then codebase doesn’t need to be set, the default value will then match all changes.
Specifies the timeout for worker-side operations, in seconds. If your repositories are particularly large, then you may need to increase this value from its default of 1200 (20 minutes).
If this option is true (the default), then the step’s logfile will describe the environment variables on the worker. In situations where the environment is not relevant and is long, it may be easier to set
a dictionary of environment strings which will be added to the child command’s environment. The usual property interpolations can be used in environment variable names and values - see Properties.