2.5.12.14. SVN
- class buildbot.steps.source.svn.SVN
The SVN build step performs a Subversion checkout or update.
There are two basic ways of setting up the checkout step, depending upon whether you are using multiple branches or not.
The SVN step should be created with the repourl argument:
repourl(required): this specifies the
URLargument that will be given to the svn checkout command. It dictates both where the repository is located and which sub-tree should be extracted. One way to specify the branch is to useInterpolate. For example, if you wanted to check out the trunk repository, you could userepourl=Interpolate("http://svn.example.com/repos/%(src::branch)s"). Alternatively, if you are using a remote Subversion repository which is accessible through HTTP at a URL ofhttp://svn.example.com/repos, and you wanted to check out thetrunk/calcsub-tree, you would directly userepourl="http://svn.example.com/repos/trunk/calc"as an argument to yourSVNstep.
If you are building from multiple branches, then you should create the SVN step with the repourl and provide branch information with Interpolate:
from buildbot.plugins import steps, util
factory.addStep(
steps.SVN(mode='incremental',
repourl=util.Interpolate(
'svn://svn.example.org/svn/%(src::branch)s/myproject')))
Alternatively, the repourl argument can be used to create the SVN step without Interpolate:
from buildbot.plugins import steps
factory.addStep(steps.SVN(mode='full',
repourl='svn://svn.example.org/svn/myproject/trunk'))
username(optional): if specified, this will be passed to the
svnbinary with a--usernameoption.password(optional): if specified, this will be passed to the
svnbinary with a--passwordoption.extra_args(optional): if specified, an array of strings that will be passed as extra arguments to the
svnbinary.keep_on_purge(optional): specific files or directories to keep between purges, like some build outputs that can be reused between builds.
depth(optional): Specify depth argument to achieve sparse checkout. Only available if worker has Subversion 1.5 or higher.
If set to
emptyupdates will not pull in any files or subdirectories not already present. If set tofiles, updates will pull in any files not already present, but not directories. If set toimmediates, updates will pull in any files or subdirectories not already present, the new subdirectories will have depth: empty. If set toinfinity, updates will pull in any files or subdirectories not already present; the new subdirectories will have depth-infinity. Infinity is equivalent to SVN default update behavior, without specifying any depth argument.preferLastChangedRev(optional): By default, the
got_revisionproperty is set to the repository’s global revision (“Revision” in the svn info output). Set this parameter toTrueto have it set to the “Last Changed Rev” instead.
mode
method
SVN’s incremental mode does not require a method. The full mode has five methods defined:
clobberIt removes the working directory for each build then makes full checkout.
freshThis always always purges local changes before updating. This deletes unversioned files and reverts everything that would appear in a svn status --no-ignore. This is equivalent to the old update mode with
always_purge.cleanThis is same as fresh except that it deletes all unversioned files generated by svn status.
copyThis first checkout source into source directory then copy the
sourcedirectory tobuilddirectory then performs the build operation in the copied directory. This way we make fresh builds with very less bandwidth to download source. The behavior of source checkout follows exactly same as incremental. It performs all the incremental checkout behavior insourcedirectory.exportSimilar to
method='copy', except usingsvn exportto create build directory so that there are no.svndirectories in the build directory.
If you are using branches, you must also make sure your ChangeSource will report the correct branch names.