def __init__(self, repourl=None, branch=None, progress=False, mode="incremental", method=None, **kwargs): self.repourl = repourl self.method = method self.mode = mode self.branch = branch self.sourcedata = "%s?%s" % (self.repourl, self.branch) self.databasename = "db.mtn" self.database = "../db.mtn" self.progress = progress Source.__init__(self, **kwargs) errors = [] if not self._hasAttrGroupMember("mode", self.mode): errors.append("mode %s is not one of %s" % (self.mode, self._listAttrGroupMembers("mode"))) if self.mode == "incremental" and self.method: errors.append("Incremental mode does not require method") if self.mode == "full": if self.method is None: self.method = "copy" elif self.method not in self.possible_methods: errors.append("Invalid method for mode == %s" % (self.mode)) if repourl is None: errors.append("you must provide repourl") if branch is None: errors.append("you must provide branch") if errors: raise ConfigErrors(errors)
def __init__(self, repourl=None, branch=None, progress=False, mode='incremental', method=None, **kwargs): self.repourl = repourl self.method = method self.mode = mode self.branch = branch self.sourcedata = "%s?%s" % (self.repourl, self.branch) self.databasename = 'db.mtn' self.database = '../db.mtn' self.progress = progress Source.__init__(self, **kwargs) errors = [] if self.mode not in self.possible_modes: errors.append("mode %s is not one of %s" % (self.mode, self.possible_modes)) if self.mode == 'incremental' and self.method: errors.append("Incremental mode does not require method") if self.mode == 'full': if self.method == None: self.method = 'copy' elif self.method not in self.possible_methods: errors.append("Invalid method for mode == %s" % (self.mode)) if repourl is None: errors.append("you must provide repourl") if branch is None: errors.append("you must provide branch") if errors: raise ConfigErrors(errors)
def __init__( self, cvsroot=None, cvsmodule="", mode="incremental", method=None, branch=None, global_options=None, extra_options=None, login=None, **kwargs ): self.cvsroot = cvsroot self.cvsmodule = cvsmodule self.branch = branch if global_options is None: global_options = [] self.global_options = global_options if extra_options is None: extra_options = [] self.extra_options = extra_options self.login = login self.mode = mode self.method = method self.srcdir = "source" if not self._hasAttrGroupMember("mode", self.mode): raise ValueError("mode %s is not one of %s" % (self.mode, self._listAttrGroupMembers("mode"))) Source.__init__(self, **kwargs)
def __init__(self, repourl=None, mode='incremental', method=None, **kwargs): self.repourl = repourl self.method = method self.mode = mode Source.__init__(self, **kwargs) errors = [] if not self._hasAttrGroupMember('mode', self.mode): errors.append("mode %s is not one of %s" % (self.mode, self._listAttrGroupMembers('mode'))) if self.mode == 'incremental' and self.method: errors.append("Incremental mode does not require method") if self.mode == 'full': if self.method is None: self.method = 'copy' elif self.method not in self.possible_methods: errors.append("Invalid method for mode == %s" % (self.mode)) if repourl is None: errors.append("you must provide repourl") if errors: raise ConfigErrors(errors)
def __init__(self, repourl=None, mode='incremental', method=None, defaultBranch=None, branchType='dirname', clobberOnBranchChange=True, **kwargs): """ @type repourl: string @param repourl: the URL which points at the Mercurial repository. if 'dirname' branches are enabled, this is the base URL to which a branch name will be appended. It should probably end in a slash. @param defaultBranch: if branches are enabled, this is the branch to use if the Build does not specify one explicitly. For 'dirname' branches, It will simply be appended to C{repourl} and the result handed to the 'hg update' command. For 'inrepo' branches, this specifies the named revision to which the tree will update after a clone. @param branchType: either 'dirname' or 'inrepo' depending on whether the branch name should be appended to the C{repourl} or the branch is a mercurial named branch and can be found within the C{repourl} @param clobberOnBranchChange: boolean, defaults to True. If set and using inrepos branches, clobber the tree at each branch change. Otherwise, just update to the branch. """ self.repourl = repourl self.defaultBranch = self.branch = defaultBranch self.branchType = branchType self.method = method self.clobberOnBranchChange = clobberOnBranchChange self.mode = mode Source.__init__(self, **kwargs) errors = [] if not self._hasAttrGroupMember('mode', self.mode): errors.append("mode %s is not one of %s" % (self.mode, self._listAttrGroupMembers('mode'))) if self.method not in self.possible_methods: errors.append("method %s is not one of %s" % (self.method, self.possible_methods)) if self.branchType not in self.possible_branchTypes: errors.append("branchType %s is not one of %s" % (self.branchType, self.possible_branchTypes)) if repourl is None: errors.append("you must provide a repourl") if errors: raise ConfigErrors(errors)
def __init__(self, repourl=None, branch=None, progress=False, **kwargs): """ @type repourl: string @param repourl: the URI which points at the monotone repository. @type branch: string @param branch: The branch or tag to check out by default. If a build specifies a different branch, it will be used instead of this. @type progress: boolean @param progress: Pass the --ticker=dot option when pulling. This can solve long fetches getting killed due to lack of output. """ Source.__init__(self, **kwargs) self.repourl = _ComputeRepositoryURL(repourl) if (not repourl): raise ValueError("you must provide a repository uri in 'repourl'") if (not branch): raise ValueError("you must provide a default branch in 'branch'") self.addFactoryArguments( repourl=repourl, branch=branch, progress=progress, ) self.args.update({ 'branch': branch, 'progress': progress, })
def __init__(self, manifest_url=None, manifest_branch="master", manifest_file="default.xml", tarball=None, **kwargs): """ @type manifest_url: string @param manifest_url: The URL which points at the repo manifests repository. @type manifest_branch: string @param manifest_branch: The manifest branch to check out by default. @type manifest_file: string @param manifest_file: The manifest to use for sync. """ Source.__init__(self, **kwargs) self.manifest_url = _ComputeRepositoryURL(manifest_url) self.addFactoryArguments(manifest_url=manifest_url, manifest_branch=manifest_branch, manifest_file=manifest_file, tarball=tarball, ) self.args.update({'manifest_branch': manifest_branch, 'manifest_file': manifest_file, 'tarball': tarball, 'manifest_override_url': None })
def __init__(self, repourl=None, mode='incremental', method=None, username=None, password=None, extra_args=None, keep_on_purge=None, depth=None, preferLastChangedRev=False, **kwargs): self.repourl = repourl self.username = username self.password = password self.extra_args = extra_args self.keep_on_purge = keep_on_purge or [] self.depth = depth self.method = method self.mode = mode self.preferLastChangedRev = preferLastChangedRev Source.__init__(self, **kwargs) errors = [] if self.mode not in self.possible_modes: errors.append("mode %s is not one of %s" % (self.mode, self.possible_modes)) if self.method not in self.possible_methods: errors.append("method %s is not one of %s" % (self.method, self.possible_methods)) if repourl is None: errors.append("you must provide repourl") if errors: raise ConfigErrors(errors)
def __init__(self, cvsroot=None, cvsmodule='', mode='incremental', method=None, branch=None, global_options=[], extra_options=[], login=None, **kwargs): self.cvsroot = cvsroot self.cvsmodule = cvsmodule self.branch = branch self.global_options = global_options self.extra_options = extra_options self.login = login self.mode = mode self.method = method self.srcdir = 'source' Source.__init__(self, **kwargs) self.addFactoryArguments( cvsroot=cvsroot, cvsmodule=cvsmodule, mode=mode, method=method, global_options=global_options, extra_options=extra_options, login=login, )
def __init__(self, repourl=None, baseURL=None, mode='incremental', method=None, defaultBranch=None, **kwargs): self.repourl = repourl self.baseURL = baseURL self.branch = defaultBranch self.mode = mode self.method = method Source.__init__(self, **kwargs) if repourl and baseURL: raise ValueError("you must provide exactly one of repourl and" " baseURL") if repourl is None and baseURL is None: raise ValueError("you must provide at least one of repourl and" " baseURL") if baseURL is not None and defaultBranch is None: raise ValueError("you must provide defaultBranch with baseURL") if not self._hasAttrGroupMember('mode', self.mode): raise ValueError("mode %s is not one of %s" % (self.mode, self._listAttrGroupMembers('mode'))) if self.mode == 'full': assert self.method in ['clean', 'fresh', 'clobber', 'copy', None]
def __init__(self, repourl=None, baseURL=None, mode='incremental', method=None, defaultBranch=None, **kwargs): self.repourl = repourl self.baseURL = baseURL self.branch = defaultBranch self.mode = mode self.method = method Source.__init__(self, **kwargs) self.addFactoryArguments(repourl=repourl, mode=mode, method=method, baseURL=baseURL, defaultBranch=defaultBranch, ) if repourl and baseURL: raise ValueError("you must provide exactly one of repourl and" " baseURL") if repourl is None and baseURL is None: raise ValueError("you must privide at least one of repourl and" " baseURL") if self.repourl is None: self.repourl = self.baseURL + defaultBranch assert self.mode in ['incremental', 'full'] if self.mode == 'full': assert self.method in ['clean', 'fresh', 'clobber', 'copy', None]
def __init__(self, repourl=None, mode='incremental', method=None, username=None, password=None, extra_args=None, keep_on_purge=None, depth=None, **kwargs): self.repourl = repourl self.username = username self.password = password self.extra_args = extra_args self.keep_on_purge = keep_on_purge or [] self.depth = depth self.method=method self.mode = mode Source.__init__(self, **kwargs) errors = [] if self.mode not in self.possible_modes: errors.append("mode %s is not one of %s" % (self.mode, self.possible_modes)) if self.method not in self.possible_methods: errors.append("method %s is not one of %s" % (self.method, self.possible_methods)) if repourl is None: errors.append("you must provide repourl") if errors: raise ConfigErrors(errors)
def __init__(self, repourl=None, mode='incremental', method=None, **kwargs): self.repourl = repourl self.method = method self.mode = mode Source.__init__(self, **kwargs) errors = [] if self.mode not in self.possible_modes: errors.append("mode %s is not one of %s" % (self.mode, self.possible_modes)) if self.mode == 'incremental' and self.method: errors.append("Incremental mode does not require method") if self.mode == 'full': if self.method is None: self.method = 'copy' elif self.method not in self.possible_methods: errors.append("Invalid method for mode == %s" % (self.mode)) if repourl is None: errors.append("you must provide repourl") if errors: raise ConfigErrors(errors)
def __init__(self, repourl=None, baseURL=None, mode='incremental', method=None, defaultBranch=None, **kwargs): self.repourl = repourl self.baseURL = baseURL self.branch = defaultBranch self.mode = mode self.method = method Source.__init__(self, **kwargs) if repourl and baseURL: raise ValueError("you must provide exactly one of repourl and" " baseURL") if repourl is None and baseURL is None: raise ValueError("you must privide at least one of repourl and" " baseURL") if baseURL is not None and defaultBranch is None: raise ValueError("you must provide defaultBranch with baseURL") assert self.mode in ['incremental', 'full'] if self.mode == 'full': assert self.method in ['clean', 'fresh', 'clobber', 'copy', None]
def __init__(self, repourl=None, mode='incremental', method=None, username=None, password=None, extra_args=None, keep_on_purge=None, depth=None, preferLastChangedRev=False, **kwargs): self.repourl = repourl self.username = username self.password = password self.extra_args = extra_args self.keep_on_purge = keep_on_purge or [] self.depth = depth self.method = method self.mode = mode self.preferLastChangedRev = preferLastChangedRev Source.__init__(self, **kwargs) errors = [] if not self._hasAttrGroupMember('mode', self.mode): errors.append("mode %s is not one of %s" % (self.mode, self._listAttrGroupMembers('mode'))) if self.method not in self.possible_methods: errors.append("method %s is not one of %s" % (self.method, self.possible_methods)) if repourl is None: errors.append("you must provide repourl") if errors: raise ConfigErrors(errors)
def __init__(self, bkurl=None, baseURL=None, directory=None, extra_args=None, **kwargs): """ @type bkurl: string @param bkurl: the URL which points to the BitKeeper server. @type baseURL: string @param baseURL: if branches are enabled, this is the base URL to which a branch name will be appended. It should probably end in a slash. Use exactly one of C{bkurl} and C{baseURL}. """ self.bkurl = _ComputeRepositoryURL(bkurl) self.baseURL = _ComputeRepositoryURL(baseURL) self.extra_args = extra_args Source.__init__(self, **kwargs) self.addFactoryArguments(bkurl=bkurl, baseURL=baseURL, directory=directory, extra_args=extra_args, ) if bkurl and baseURL: raise ValueError("you must use exactly one of bkurl and baseURL")
def __init__(self, cvsroot=None, cvsmodule='', mode='incremental', method=None, branch=None, global_options=None, extra_options=None, login=None, **kwargs): self.cvsroot = cvsroot self.cvsmodule = cvsmodule self.branch = branch if global_options is None: global_options = [] self.global_options = global_options if extra_options is None: extra_options = [] self.extra_options = extra_options self.login = login self.mode = mode self.method = method self.srcdir = 'source' if not self._hasAttrGroupMember('mode', self.mode): raise ValueError("mode %s is not one of %s" % (self.mode, self._listAttrGroupMembers('mode'))) Source.__init__(self, **kwargs)
def __init__(self, repourl=None, baseURL=None, mode='incremental', method=None, defaultBranch=None, **kwargs): self.repourl = repourl self.baseURL = baseURL self.branch = defaultBranch self.mode = mode self.method = method Source.__init__(self, **kwargs) if repourl and baseURL: raise ValueError("you must provide exactly one of repourl and" " baseURL") if repourl is None and baseURL is None: raise ValueError("you must privide at least one of repourl and" " baseURL") if baseURL is not None and defaultBranch is None: raise ValueError("you must provide defaultBranch with baseURL") if not self._hasAttrGroupMember('mode', self.mode): raise ValueError("mode %s is not one of %s" % (self.mode, self._listAttrGroupMembers('mode'))) if self.mode == 'full': assert self.method in ['clean', 'fresh', 'clobber', 'copy', None]
def __init__(self, cvsroot=None, cvsmodule='', mode='incremental', method=None, branch=None, global_options=None, extra_options=None, login=None, **kwargs): self.cvsroot = cvsroot self.cvsmodule = cvsmodule self.branch = branch if global_options is None: global_options = [] self.global_options = global_options if extra_options is None: extra_options = [] self.extra_options = extra_options self.login = login self.mode = mode self.method = method self.srcdir = 'source' Source.__init__(self, **kwargs)
def __init__( self, repourl=None, mode="incremental", method=None, defaultBranch=None, branchType="dirname", clobberOnBranchChange=True, **kwargs ): """ @type repourl: string @param repourl: the URL which points at the Mercurial repository. if 'dirname' branches are enabled, this is the base URL to which a branch name will be appended. It should probably end in a slash. @param defaultBranch: if branches are enabled, this is the branch to use if the Build does not specify one explicitly. For 'dirname' branches, It will simply be appended to C{repourl} and the result handed to the 'hg update' command. For 'inrepo' branches, this specifies the named revision to which the tree will update after a clone. @param branchType: either 'dirname' or 'inrepo' depending on whether the branch name should be appended to the C{repourl} or the branch is a mercurial named branch and can be found within the C{repourl} @param clobberOnBranchChange: boolean, defaults to True. If set and using inrepos branches, clobber the tree at each branch change. Otherwise, just update to the branch. """ self.repourl = repourl self.defaultBranch = self.branch = defaultBranch self.branchType = branchType self.method = method self.clobberOnBranchChange = clobberOnBranchChange self.mode = mode Source.__init__(self, **kwargs) errors = [] if self.mode not in self.possible_modes: errors.append("mode %s is not one of %s" % (self.mode, self.possible_modes)) if self.method not in self.possible_methods: errors.append("method %s is not one of %s" % (self.method, self.possible_methods)) if self.branchType not in self.possible_branchTypes: errors.append("branchType %s is not one of %s" % (self.branchType, self.possible_branchTypes)) if repourl is None: errors.append("you must provide a repourl") if errors: raise ConfigErrors(errors)
def __init__(self, bkurl=None, baseURL=None, directory=None, extra_args=None, **kwargs): """ @type bkurl: string @param bkurl: the URL which points to the BitKeeper server. @type baseURL: string @param baseURL: if branches are enabled, this is the base URL to which a branch name will be appended. It should probably end in a slash. Use exactly one of C{bkurl} and C{baseURL}. """ self.bkurl = _ComputeRepositoryURL(self, bkurl) self.baseURL = _ComputeRepositoryURL(self, baseURL) self.extra_args = extra_args Source.__init__(self, **kwargs) if bkurl and baseURL: raise ValueError("you must use exactly one of bkurl and baseURL")
def __init__(self, repourl=None, branch=None, progress=False, mode='incremental', method=None, **kwargs): self.repourl = repourl self.method = method self.mode = mode self.branch = branch self.sourcedata = "%s?%s" % (self.repourl, self.branch) self.databasename = 'db.mtn' self.database = '../db.mtn' self.progress = progress Source.__init__(self, **kwargs) errors = [] if not self._hasAttrGroupMember('mode', self.mode): errors.append("mode %s is not one of %s" % (self.mode, self._listAttrGroupMembers('mode'))) if self.mode == 'incremental' and self.method: errors.append("Incremental mode does not require method") if self.mode == 'full': if self.method is None: self.method = 'copy' elif self.method not in self.possible_methods: errors.append("Invalid method for mode == %s" % (self.mode)) if repourl is None: errors.append("you must provide repourl") if branch is None: errors.append("you must provide branch") if errors: raise ConfigErrors(errors)
def __init__(self, repourl=None, baseURL=None, defaultBranch=None, **kwargs): """ @type repourl: string @param repourl: the URL which points at the Darcs repository. This is used as the default branch. Using C{repourl} does not enable builds of alternate branches: use C{baseURL} to enable this. Use either C{repourl} or C{baseURL}, not both. @param baseURL: if branches are enabled, this is the base URL to which a branch name will be appended. It should probably end in a slash. Use exactly one of C{repourl} and C{baseURL}. @param defaultBranch: if branches are enabled, this is the branch to use if the Build does not specify one explicitly. It will simply be appended to C{baseURL} and the result handed to the 'darcs pull' command. """ self.repourl = _ComputeRepositoryURL(repourl) self.baseURL = _ComputeRepositoryURL(baseURL) self.branch = defaultBranch Source.__init__(self, **kwargs) self.addFactoryArguments(repourl=repourl, baseURL=baseURL, defaultBranch=defaultBranch, ) assert self.args['mode'] != "export", \ "Darcs does not have an 'export' mode" if repourl and baseURL: raise ValueError("you must provide exactly one of repourl and" " baseURL")
def __init__(self, repourl=None, branch=None, progress=False, **kwargs): """ @type repourl: string @param repourl: the URI which points at the monotone repository. @type branch: string @param branch: The branch or tag to check out by default. If a build specifies a different branch, it will be used instead of this. @type progress: boolean @param progress: Pass the --ticker=dot option when pulling. This can solve long fetches getting killed due to lack of output. """ Source.__init__(self, **kwargs) self.repourl = _ComputeRepositoryURL(repourl) if (not repourl): raise ValueError("you must provide a repository uri in 'repourl'") if (not branch): raise ValueError("you must provide a default branch in 'branch'") self.addFactoryArguments(repourl=repourl, branch=branch, progress=progress, ) self.args.update({'branch': branch, 'progress': progress, })
def __init__(self, manifest_url=None, manifest_branch="master", manifest_file="default.xml", tarball=None, **kwargs): """ @type manifest_url: string @param manifest_url: The URL which points at the repo manifests repository. @type manifest_branch: string @param manifest_branch: The manifest branch to check out by default. @type manifest_file: string @param manifest_file: The manifest to use for sync. """ Source.__init__(self, **kwargs) self.manifest_url = _ComputeRepositoryURL(manifest_url) self.addFactoryArguments( manifest_url=manifest_url, manifest_branch=manifest_branch, manifest_file=manifest_file, tarball=tarball, ) self.args.update({ 'manifest_branch': manifest_branch, 'manifest_file': manifest_file, 'tarball': tarball, 'manifest_override_url': None })
def __init__(self, p4port, p4user, p4passwd, p4client, **kwargs): assert kwargs["mode"] == "copy", "P4Sync can only be used in mode=copy" self.branch = None Source.__init__(self, **kwargs) self.args["p4port"] = p4port self.args["p4user"] = p4user self.args["p4passwd"] = p4passwd self.args["p4client"] = p4client
def __init__(self, repourl=None, branch='HEAD', mode='incremental', method=None, submodules=False, shallow=False, progress=False, retryFetch=False, clobberOnFailure=False, getDescription=False, **kwargs): """ @type repourl: string @param repourl: the URL which points at the git repository @type branch: string @param branch: The branch or tag to check out by default. If a build specifies a different branch, it will be used instead of this. @type submodules: boolean @param submodules: Whether or not to update (and initialize) git submodules. @type mode: string @param mode: Type of checkout. Described in docs. @type method: string @param method: Full builds can be done is different ways. This parameter specifies which method to use. @type progress: boolean @param progress: Pass the --progress option when fetching. This can solve long fetches getting killed due to lack of output, but requires Git 1.7.2+. @type shallow: boolean @param shallow: Use a shallow or clone, if possible @type retryFetch: boolean @param retryFetch: Retry fetching before failing source checkout. @type getDescription: boolean or dict @param getDescription: Use 'git describe' to describe the fetched revision """ if not getDescription and not isinstance(getDescription, dict): getDescription = False self.branch = branch self.method = method self.prog = progress self.repourl = repourl self.retryFetch = retryFetch self.submodules = submodules self.shallow = shallow self.fetchcount = 0 self.clobberOnFailure = clobberOnFailure self.mode = mode self.getDescription = getDescription Source.__init__(self, **kwargs) assert self.mode in ['incremental', 'full'] assert self.repourl is not None if self.mode == 'full': assert self.method in ['clean', 'fresh', 'clobber', 'copy', None] assert isinstance(self.getDescription, (bool, dict))
def __init__(self, manifestURL=None, manifestBranch="master", manifestFile="default.xml", tarball=None, jobs=None, syncAllBranches=False, updateTarballAge=7 * 24.0 * 3600.0, manifestOverrideUrl=None, repoDownloads=None, depth=0, **kwargs): """ @type manifestURL: string @param manifestURL: The URL which points at the repo manifests repository. @type manifestBranch: string @param manifestBranch: The manifest branch to check out by default. @type manifestFile: string @param manifestFile: The manifest to use for sync. @type syncAllBranches: bool. @param syncAllBranches: true, then we must slowly synchronize all branches. @type updateTarballAge: float @param updateTarballAge: renderable to determine the update tarball policy, given properties Returns: max age of tarball in seconds, or None, if we want to skip tarball update @type manifestOverrideUrl: string @param manifestOverrideUrl: optional http URL for overriding the manifest usually coming from Property setup by a ForceScheduler @type repoDownloads: list of strings @param repoDownloads: optional repo download to perform after the repo sync @type depth: integer @param depth: optional depth parameter to repo init. If specified, create a shallow clone with given depth. """ self.manifestURL = manifestURL self.manifestBranch = manifestBranch self.manifestFile = manifestFile self.tarball = tarball self.jobs = jobs self.syncAllBranches = syncAllBranches self.updateTarballAge = updateTarballAge self.manifestOverrideUrl = manifestOverrideUrl if repoDownloads is None: repoDownloads = [] self.repoDownloads = repoDownloads self.depth = depth Source.__init__(self, **kwargs) assert self.manifestURL is not None
def __init__(self, repourl=None, baseURL=None, defaultBranch=None, branchType='dirname', clobberOnBranchChange=True, **kwargs): """ @type repourl: string @param repourl: the URL which points at the Mercurial repository. This uses the 'default' branch unless defaultBranch is specified below and the C{branchType} is set to 'inrepo'. It is an error to specify a branch without setting the C{branchType} to 'inrepo'. @param baseURL: if 'dirname' branches are enabled, this is the base URL to which a branch name will be appended. It should probably end in a slash. Use exactly one of C{repourl} and C{baseURL}. @param defaultBranch: if branches are enabled, this is the branch to use if the Build does not specify one explicitly. For 'dirname' branches, It will simply be appended to C{baseURL} and the result handed to the 'hg update' command. For 'inrepo' branches, this specifies the named revision to which the tree will update after a clone. @param branchType: either 'dirname' or 'inrepo' depending on whether the branch name should be appended to the C{baseURL} or the branch is a mercurial named branch and can be found within the C{repourl} @param clobberOnBranchChange: boolean, defaults to True. If set and using inrepos branches, clobber the tree at each branch change. Otherwise, just update to the branch. """ self.repourl = _ComputeRepositoryURL(repourl) self.baseURL = _ComputeRepositoryURL(baseURL) self.branch = defaultBranch self.branchType = branchType self.clobberOnBranchChange = clobberOnBranchChange Source.__init__(self, **kwargs) self.addFactoryArguments( repourl=repourl, baseURL=baseURL, defaultBranch=defaultBranch, branchType=branchType, clobberOnBranchChange=clobberOnBranchChange, ) if repourl and baseURL: raise ValueError("you must provide exactly one of repourl and" " baseURL")
def __init__(self, manifest_url=None, manifest_branch="master", manifest_file="default.xml", tarball=None, jobs=None, sync_all_branches=default_sync_all_branches, update_tarball=default_update_tarball, **kwargs): """ @type manifest_url: string @param manifest_url: The URL which points at the repo manifests repository. @type manifest_branch: string @param manifest_branch: The manifest branch to check out by default. @type manifest_file: string @param manifest_file: The manifest to use for sync. @type sync_all_branches: lambda properties: bool. @param sync_all_branches: returns the boolean we must synchronize all branches. @type update_tarball: lambda (properties,bool) : float @param update_tarball: function to determine the update tarball policy, given properties, and boolean indicating whether the last repo sync was on all branches Returns: max age of tarball in seconds, or None, if we want to skip tarball update """ self.manifest_url = manifest_url self.manifest_branch = manifest_branch self.manifest_file = manifest_file self.tarball = tarball self.jobs = jobs def copy_callable(param_name, f): if not callable(f): raise ValueError("%s must be callable,but is of type %s" % (param_name, type(f))) setattr(self, param_name, f) copy_callable("sync_all_branches", sync_all_branches) copy_callable("update_tarball", update_tarball) Source.__init__(self, **kwargs) assert self.manifest_url is not None self.addFactoryArguments( manifest_url=manifest_url, manifest_branch=manifest_branch, manifest_file=manifest_file, tarball=tarball, sync_all_branches=sync_all_branches, update_tarball=update_tarball, )
def __init__(self, repourl, branch='master', **kwargs): self.repourl = repourl self.branch = branch kwargs['env'] = { 'GIT_AUTHOR_EMAIL': '*****@*****.**', 'GIT_AUTHOR_NAME': 'ClusterHQ Buildbot', 'GIT_COMMITTER_EMAIL': '*****@*****.**', 'GIT_COMMITTER_NAME': 'ClusterHQ Buildbot', } Source.__init__(self, **kwargs) self.addFactoryArguments(repourl=repourl, branch=branch)
def __init__(self, p4base=None, defaultBranch=None, p4port=None, p4user=None, p4passwd=None, p4extra_views=[], p4line_end='local', p4client='buildbot_%(slave)s_%(builder)s', **kwargs): """ @type p4base: string @param p4base: A view into a perforce depot, typically "//depot/proj/" @type defaultBranch: string @param defaultBranch: Identify a branch to build by default. Perforce is a view based branching system. So, the branch is normally the name after the base. For example, branch=1.0 is view=//depot/proj/1.0/... branch=1.1 is view=//depot/proj/1.1/... @type p4port: string @param p4port: Specify the perforce server to connection in the format <host>:<port>. Example "perforce.example.com:1666" @type p4user: string @param p4user: The perforce user to run the command as. @type p4passwd: string @param p4passwd: The password for the perforce user. @type p4extra_views: list of tuples @param p4extra_views: Extra views to be added to the client that is being used. @type p4line_end: string @param p4line_end: value of the LineEnd client specification property @type p4client: string @param p4client: The perforce client to use for this buildslave. """ self.p4base = _ComputeRepositoryURL(p4base) self.branch = defaultBranch Source.__init__(self, **kwargs) self.addFactoryArguments(p4base=p4base, defaultBranch=defaultBranch, p4port=p4port, p4user=p4user, p4passwd=p4passwd, p4extra_views=p4extra_views, p4line_end=p4line_end, p4client=p4client, ) self.args['p4port'] = p4port self.args['p4user'] = p4user self.args['p4passwd'] = p4passwd self.args['p4extra_views'] = p4extra_views self.args['p4line_end'] = p4line_end self.p4client = p4client
def __init__(self, repourl=None, branch="master", submodules=False, ignore_ignores=None, reference=None, shallow=False, progress=False, **kwargs): """ @type repourl: string @param repourl: the URL which points at the git repository @type branch: string @param branch: The branch or tag to check out by default. If a build specifies a different branch, it will be used instead of this. @type submodules: boolean @param submodules: Whether or not to update (and initialize) git submodules. @type reference: string @param reference: The path to a reference repository to obtain objects from, if any. @type shallow: boolean @param shallow: Use a shallow or clone, if possible @type progress: boolean @param progress: Pass the --progress option when fetching. This can solve long fetches getting killed due to lack of output, but requires Git 1.7.2+. """ Source.__init__(self, **kwargs) self.repourl = _ComputeRepositoryURL(repourl) self.branch = branch self.addFactoryArguments( repourl=repourl, branch=branch, submodules=submodules, ignore_ignores=ignore_ignores, reference=reference, shallow=shallow, progress=progress, ) self.args.update({ 'submodules': submodules, 'ignore_ignores': ignore_ignores, 'reference': reference, 'shallow': shallow, 'progress': progress, })
def __init__(self, p4port, p4user, p4passwd, p4client, **kwargs): assert kwargs['mode'] == "copy", "P4Sync can only be used in mode=copy" self.branch = None Source.__init__(self, **kwargs) self.addFactoryArguments(p4port=p4port, p4user=p4user, p4passwd=p4passwd, p4client=p4client, ) self.args['p4port'] = p4port self.args['p4user'] = p4user self.args['p4passwd'] = p4passwd self.args['p4client'] = p4client
def __init__(self, manifest_url=None, manifest_branch="master", manifest_file="default.xml", tarball=None, jobs=None, sync_all_branches=default_sync_all_branches, update_tarball=default_update_tarball, **kwargs): """ @type manifest_url: string @param manifest_url: The URL which points at the repo manifests repository. @type manifest_branch: string @param manifest_branch: The manifest branch to check out by default. @type manifest_file: string @param manifest_file: The manifest to use for sync. @type sync_all_branches: lambda properties: bool. @param sync_all_branches: returns the boolean we must synchronize all branches. @type update_tarball: lambda (properties,bool) : float @param update_tarball: function to determine the update tarball policy, given properties, and boolean indicating whether the last repo sync was on all branches Returns: max age of tarball in seconds, or None, if we want to skip tarball update """ self.manifest_url = manifest_url self.manifest_branch = manifest_branch self.manifest_file = manifest_file self.tarball = tarball self.jobs = jobs def copy_callable(param_name,f): if not callable(f): raise ValueError("%s must be callable,but is of type %s"%(param_name,type(f))) setattr(self, param_name, f) copy_callable("sync_all_branches",sync_all_branches) copy_callable("update_tarball",update_tarball) Source.__init__(self, **kwargs) assert self.manifest_url is not None self.addFactoryArguments(manifest_url=manifest_url, manifest_branch=manifest_branch, manifest_file=manifest_file, tarball=tarball, sync_all_branches=sync_all_branches, update_tarball=update_tarball, )
def __init__(self, repourl=None, branch="master", submodules=False, ignore_ignores=None, reference=None, shallow=False, progress=False, **kwargs): """ @type repourl: string @param repourl: the URL which points at the git repository @type branch: string @param branch: The branch or tag to check out by default. If a build specifies a different branch, it will be used instead of this. @type submodules: boolean @param submodules: Whether or not to update (and initialize) git submodules. @type reference: string @param reference: The path to a reference repository to obtain objects from, if any. @type shallow: boolean @param shallow: Use a shallow or clone, if possible @type progress: boolean @param progress: Pass the --progress option when fetching. This can solve long fetches getting killed due to lack of output, but requires Git 1.7.2+. """ Source.__init__(self, **kwargs) self.repourl = _ComputeRepositoryURL(repourl) self.branch = branch self.addFactoryArguments(repourl=repourl, branch=branch, submodules=submodules, ignore_ignores=ignore_ignores, reference=reference, shallow=shallow, progress=progress, ) self.args.update({'submodules': submodules, 'ignore_ignores': ignore_ignores, 'reference': reference, 'shallow': shallow, 'progress': progress, })
def __init__(self, cvsroot=None, cvsmodule='', mode='incremental', method=None, branch=None, global_options=[], extra_options=[], login=None, **kwargs): self.cvsroot = cvsroot self.cvsmodule = cvsmodule self.branch = branch self.global_options = global_options self.extra_options = extra_options self.login = login self.mode = mode self.method = method self.srcdir = 'source' Source.__init__(self, **kwargs)
def __init__(self, repourl=None, baseURL=None, defaultBranch=None, branchType='dirname', clobberOnBranchChange=True, **kwargs): """ @type repourl: string @param repourl: the URL which points at the Mercurial repository. This uses the 'default' branch unless defaultBranch is specified below and the C{branchType} is set to 'inrepo'. It is an error to specify a branch without setting the C{branchType} to 'inrepo'. @param baseURL: if 'dirname' branches are enabled, this is the base URL to which a branch name will be appended. It should probably end in a slash. Use exactly one of C{repourl} and C{baseURL}. @param defaultBranch: if branches are enabled, this is the branch to use if the Build does not specify one explicitly. For 'dirname' branches, It will simply be appended to C{baseURL} and the result handed to the 'hg update' command. For 'inrepo' branches, this specifies the named revision to which the tree will update after a clone. @param branchType: either 'dirname' or 'inrepo' depending on whether the branch name should be appended to the C{baseURL} or the branch is a mercurial named branch and can be found within the C{repourl} @param clobberOnBranchChange: boolean, defaults to True. If set and using inrepos branches, clobber the tree at each branch change. Otherwise, just update to the branch. """ self.repourl = _ComputeRepositoryURL(repourl) self.baseURL = _ComputeRepositoryURL(baseURL) self.branch = defaultBranch self.branchType = branchType self.clobberOnBranchChange = clobberOnBranchChange Source.__init__(self, **kwargs) self.addFactoryArguments(repourl=repourl, baseURL=baseURL, defaultBranch=defaultBranch, branchType=branchType, clobberOnBranchChange=clobberOnBranchChange, ) if repourl and baseURL: raise ValueError("you must provide exactly one of repourl and" " baseURL")
def __init__(self, p4port, p4user, p4passwd, p4client, **kwargs): assert kwargs['mode'] == "copy", "P4Sync can only be used in mode=copy" self.branch = None Source.__init__(self, **kwargs) self.addFactoryArguments( p4port=p4port, p4user=p4user, p4passwd=p4passwd, p4client=p4client, ) self.args['p4port'] = p4port self.args['p4user'] = p4user self.args['p4passwd'] = p4passwd self.args['p4client'] = p4client
def __init__(self, svnurl=None, baseURL=None, defaultBranch=None, directory=None, username=None, password=None, extra_args=None, keep_on_purge=None, ignore_ignores=None, always_purge=None, depth=None, **kwargs): """ @type svnurl: string @param svnurl: the URL which points to the Subversion server, combining the access method (HTTP, ssh, local file), the repository host/port, the repository path, the sub-tree within the repository, and the branch to check out. Use exactly one of C{svnurl} and C{baseURL}. @param baseURL: if branches are enabled, this is the base URL to which a branch name will be appended. It should probably end in a slash. Use exactly one of C{svnurl} and C{baseURL}. @param defaultBranch: if branches are enabled, this is the branch to use if the Build does not specify one explicitly. It will simply be appended to C{baseURL} and the result handed to the SVN command. @type username: string @param username: username to pass to svn's --username @type password: string @param password: password to pass to svn's --password """ if not 'workdir' in kwargs and directory is not None: # deal with old configs warn("Please use workdir=, not directory=", DeprecationWarning) kwargs['workdir'] = directory self.svnurl = svnurl and _ComputeRepositoryURL(self, svnurl) self.baseURL = _ComputeRepositoryURL(self, baseURL) self.branch = defaultBranch self.username = username self.password = password self.extra_args = extra_args self.keep_on_purge = keep_on_purge self.ignore_ignores = ignore_ignores self.always_purge = always_purge self.depth = depth Source.__init__(self, **kwargs) if svnurl and baseURL: raise ValueError("you must use either svnurl OR baseURL")
def __init__(self, repourl=None, baseURL=None, defaultBranch=None, forceSharedRepo=None, **kwargs): """ @type repourl: string @param repourl: the URL which points at the bzr repository. This is used as the default branch. Using C{repourl} does not enable builds of alternate branches: use C{baseURL} to enable this. Use either C{repourl} or C{baseURL}, not both. @param baseURL: if branches are enabled, this is the base URL to which a branch name will be appended. It should probably end in a slash. Use exactly one of C{repourl} and C{baseURL}. @param defaultBranch: if branches are enabled, this is the branch to use if the Build does not specify one explicitly. It will simply be appended to C{baseURL} and the result handed to the 'bzr checkout pull' command. @param forceSharedRepo: Boolean, defaults to False. If set to True, the working directory will be made into a bzr shared repository if it is not already. Shared repository greatly reduces the amount of history data that needs to be downloaded if not using update/copy mode, or if using update/copy mode with multiple branches. """ self.repourl = _ComputeRepositoryURL(repourl) self.baseURL = _ComputeRepositoryURL(baseURL) self.branch = defaultBranch Source.__init__(self, **kwargs) self.addFactoryArguments(repourl=repourl, baseURL=baseURL, defaultBranch=defaultBranch, forceSharedRepo=forceSharedRepo) self.args.update({'forceSharedRepo': forceSharedRepo}) if repourl and baseURL: raise ValueError("you must provide exactly one of repourl and" " baseURL")
def __init__(self, repourl=None, baseURL=None, defaultBranch=None, forceSharedRepo=None, **kwargs): """ @type repourl: string @param repourl: the URL which points at the bzr repository. This is used as the default branch. Using C{repourl} does not enable builds of alternate branches: use C{baseURL} to enable this. Use either C{repourl} or C{baseURL}, not both. @param baseURL: if branches are enabled, this is the base URL to which a branch name will be appended. It should probably end in a slash. Use exactly one of C{repourl} and C{baseURL}. @param defaultBranch: if branches are enabled, this is the branch to use if the Build does not specify one explicitly. It will simply be appended to C{baseURL} and the result handed to the 'bzr checkout pull' command. @param forceSharedRepo: Boolean, defaults to False. If set to True, the working directory will be made into a bzr shared repository if it is not already. Shared repository greatly reduces the amount of history data that needs to be downloaded if not using update/copy mode, or if using update/copy mode with multiple branches. """ self.repourl = _ComputeRepositoryURL(repourl) self.baseURL = _ComputeRepositoryURL(baseURL) self.branch = defaultBranch Source.__init__(self, **kwargs) self.addFactoryArguments(repourl=repourl, baseURL=baseURL, defaultBranch=defaultBranch, forceSharedRepo=forceSharedRepo ) self.args.update({'forceSharedRepo': forceSharedRepo}) if repourl and baseURL: raise ValueError("you must provide exactly one of repourl and" " baseURL")
def __init__(self, repourl=None, baseURL=None, mode="incremental", method=None, defaultBranch=None, **kwargs): self.repourl = repourl self.baseURL = baseURL self.branch = defaultBranch self.mode = mode self.method = method Source.__init__(self, **kwargs) if repourl and baseURL: raise ValueError("you must provide exactly one of repourl and" " baseURL") if repourl is None and baseURL is None: raise ValueError("you must privide at least one of repourl and" " baseURL") if baseURL is not None and defaultBranch is None: raise ValueError("you must provide defaultBranch with baseURL") assert self.mode in ["incremental", "full"] if self.mode == "full": assert self.method in ["clean", "fresh", "clobber", "copy", None]
def __init__(self, repourl=None, baseURL=None, mode='incremental', method=None, defaultBranch=None, username=None, password=None, extra_args=None, keep_on_purge=None, depth=None, **kwargs): self.repourl = repourl self.baseURL = baseURL self.branch = defaultBranch self.username = username self.password = password self.extra_args = extra_args self.keep_on_purge = keep_on_purge or [] self.depth = depth self.method=method self.mode = mode Source.__init__(self, **kwargs) self.addFactoryArguments(repourl=repourl, baseURL=baseURL, mode=mode, method=method, defaultBranch=defaultBranch, password=password, username=username, extra_args=extra_args, keep_on_purge=keep_on_purge, depth=depth, ) errors = [] if self.mode not in self.possible_modes: errors.append("mode %s is not one of %s" % (self.mode, self.possible_modes)) if self.method not in self.possible_methods: errors.append("method %s is not one of %s" % (self.method, self.possible_methods)) if repourl and baseURL: errors.append("you must provide exactly one of repourl and baseURL") if repourl is None and baseURL is None: errors.append("you must privide at least one of repourl and baseURL") if errors: raise ConfigErrors(errors)
def __init__(self, repourl=None, baseURL=None, defaultBranch=None, **kwargs): """ @type repourl: string @param repourl: the URL which points at the Darcs repository. This is used as the default branch. Using C{repourl} does not enable builds of alternate branches: use C{baseURL} to enable this. Use either C{repourl} or C{baseURL}, not both. @param baseURL: if branches are enabled, this is the base URL to which a branch name will be appended. It should probably end in a slash. Use exactly one of C{repourl} and C{baseURL}. @param defaultBranch: if branches are enabled, this is the branch to use if the Build does not specify one explicitly. It will simply be appended to C{baseURL} and the result handed to the 'darcs pull' command. """ self.repourl = _ComputeRepositoryURL(repourl) self.baseURL = _ComputeRepositoryURL(baseURL) self.branch = defaultBranch Source.__init__(self, **kwargs) self.addFactoryArguments( repourl=repourl, baseURL=baseURL, defaultBranch=defaultBranch, ) assert self.args['mode'] != "export", \ "Darcs does not have an 'export' mode" if repourl and baseURL: raise ValueError("you must provide exactly one of repourl and" " baseURL")
def __init__( self, manifest_url=None, manifest_branch="master", manifest_file="default.xml", tarball=None, **kwargs ): """ @type manifest_url: string @param manifest_url: The URL which points at the repo manifests repository. @type manifest_branch: string @param manifest_branch: The manifest branch to check out by default. @type manifest_file: string @param manifest_file: The manifest to use for sync. """ Source.__init__(self, **kwargs) self.manifest_url = _ComputeRepositoryURL(manifest_url) self.args.update( { "manifest_branch": manifest_branch, "manifest_file": manifest_file, "tarball": tarball, "manifest_override_url": None, } )
def __init__(self, cvsroot=None, cvsmodule="", global_options=[], branch=None, checkoutDelay=None, checkout_options=[], export_options=[], extra_options=[], login=None, **kwargs): """ @type cvsroot: string @param cvsroot: CVS Repository from which the source tree should be obtained. '/home/warner/Repository' for local or NFS-reachable repositories, ':pserver:[email protected]:/cvs' for anonymous CVS, '[email protected]:/cvs' for non-anonymous CVS or CVS over ssh. Lots of possibilities, check the CVS documentation for more. @type cvsmodule: string @param cvsmodule: subdirectory of CVS repository that should be retrieved @type login: string or None @param login: if not None, a string which will be provided as a password to the 'cvs login' command, used when a :pserver: method is used to access the repository. This login is only needed once, but must be run each time (just before the CVS operation) because there is no way for the buildslave to tell whether it was previously performed or not. @type branch: string @param branch: the default branch name, will be used in a '-r' argument to specify which branch of the source tree should be used for this checkout. Defaults to None, which means to use 'HEAD'. @type checkoutDelay: int or None @param checkoutDelay: if not None, the number of seconds to put between the last known Change and the timestamp given to the -D argument. This defaults to exactly half of the parent Build's .treeStableTimer, but it could be set to something else if your CVS change notification has particularly weird latency characteristics. @type global_options: list of strings @param global_options: these arguments are inserted in the cvs command line, before the 'checkout'/'update' command word. See 'cvs --help-options' for a list of what may be accepted here. ['-r'] will make the checked out files read only. ['-r', '-R'] will also assume the repository is read-only (I assume this means it won't use locks to insure atomic access to the ,v files). @type checkout_options: list of strings @param checkout_options: these arguments are inserted in the cvs command line, after 'checkout' but before branch or revision specifiers. @type export_options: list of strings @param export_options: these arguments are inserted in the cvs command line, after 'export' but before branch or revision specifiers. @type extra_options: list of strings @param extra_options: these arguments are inserted in the cvs command line, after 'checkout' or 'export' but before branch or revision specifiers. """ self.checkoutDelay = checkoutDelay self.branch = branch self.cvsroot = _ComputeRepositoryURL(cvsroot) Source.__init__(self, **kwargs) self.addFactoryArguments( cvsroot=cvsroot, cvsmodule=cvsmodule, global_options=global_options, checkout_options=checkout_options, export_options=export_options, extra_options=extra_options, branch=branch, checkoutDelay=checkoutDelay, login=login, ) self.args.update({ 'cvsmodule': cvsmodule, 'global_options': global_options, 'checkout_options': checkout_options, 'export_options': export_options, 'extra_options': extra_options, 'login': login, })
def __init__( self, repourl=None, branch="HEAD", mode="incremental", method=None, reference=None, submodules=False, shallow=False, progress=False, retryFetch=False, clobberOnFailure=False, getDescription=False, config=None, origin=None, **kwargs ): """ @type repourl: string @param repourl: the URL which points at the git repository @type branch: string @param branch: The branch or tag to check out by default. If a build specifies a different branch, it will be used instead of this. @type submodules: boolean @param submodules: Whether or not to update (and initialize) git submodules. @type mode: string @param mode: Type of checkout. Described in docs. @type method: string @param method: Full builds can be done is different ways. This parameter specifies which method to use. @type reference: string @param reference: If available use a reference repo. Uses `--reference` in git command. Refer `git clone --help` @type progress: boolean @param progress: Pass the --progress option when fetching. This can solve long fetches getting killed due to lack of output, but requires Git 1.7.2+. @type shallow: boolean or integer @param shallow: Use a shallow or clone, if possible @type retryFetch: boolean @param retryFetch: Retry fetching before failing source checkout. @type getDescription: boolean or dict @param getDescription: Use 'git describe' to describe the fetched revision @type origin: string @param origin: The name to give the remote when cloning (default None) @type config: dict @param config: Git configuration options to enable when running git """ if not getDescription and not isinstance(getDescription, dict): getDescription = False self.branch = branch self.method = method self.prog = progress self.repourl = repourl self.reference = reference self.retryFetch = retryFetch self.submodules = submodules self.shallow = shallow self.clobberOnFailure = clobberOnFailure self.mode = mode self.getDescription = getDescription self.config = config self.supportsBranch = True self.supportsSubmoduleCheckout = True self.srcdir = "source" self.origin = origin Source.__init__(self, **kwargs) if not self.repourl: bbconfig.error("Git: must provide repourl.") if isinstance(self.mode, string_types): if not self._hasAttrGroupMember("mode", self.mode): bbconfig.error("Git: mode must be %s" % (" or ".join(self._listAttrGroupMembers("mode")))) if isinstance(self.method, string_types): if self.mode == "full" and self.method not in ["clean", "fresh", "clobber", "copy", None]: bbconfig.error("Git: invalid method for mode 'full'.") if self.shallow and (self.mode != "full" or self.method != "clobber"): bbconfig.error("Git: shallow only possible with mode 'full' and method 'clobber'.") if not isinstance(self.getDescription, (bool, dict)): bbconfig.error("Git: getDescription must be a boolean or a dict.")
def __init__(self, mode='update', retry=None, **kwargs): """ @type mode: string @param mode: the kind of VC operation that is desired: - 'update': specifies that the checkout/update should be performed directly into the workdir. Each build is performed in the same directory, allowing for incremental builds. This minimizes disk space, bandwidth, and CPU time. However, it may encounter problems if the build process does not handle dependencies properly (if you must sometimes do a 'clean build' to make sure everything gets compiled), or if source files are deleted but generated files can influence test behavior (e.g. python's .pyc files), or when source directories are deleted but generated files prevent CVS from removing them. When used with a patched checkout, from a previous buildbot try for instance, it will try to "revert" the changes first and will do a clobber if it is unable to get a clean checkout. The behavior is SCM-dependent. - 'copy': specifies that the source-controlled workspace should be maintained in a separate directory (called the 'copydir'), using checkout or update as necessary. For each build, a new workdir is created with a copy of the source tree (rm -rf workdir; cp -R -P -p copydir workdir). This doubles the disk space required, but keeps the bandwidth low (update instead of a full checkout). A full 'clean' build is performed each time. This avoids any generated-file build problems, but is still occasionally vulnerable to problems such as a CVS repository being manually rearranged (causing CVS errors on update) which are not an issue with a full checkout. - 'clobber': specifies that the working directory should be deleted each time, necessitating a full checkout for each build. This insures a clean build off a complete checkout, avoiding any of the problems described above, but is bandwidth intensive, as the whole source tree must be pulled down for each build. - 'export': is like 'clobber', except that e.g. the 'cvs export' command is used to create the working directory. This command removes all VC metadata files (the CVS/.svn/{arch} directories) from the tree, which is sometimes useful for creating source tarballs (to avoid including the metadata in the tar file). Not all VC systems support export. @type retry: tuple of ints (delay, repeats) (or None) @param retry: if provided, VC update failures are re-attempted up to REPEATS times, with DELAY seconds between each attempt. Some users have slaves with poor connectivity to their VC repository, and they say that up to 80% of their build failures are due to transient network failures that could be handled by simply retrying a couple times. """ Source.__init__(self, **kwargs) assert mode in ("update", "copy", "clobber", "export") if retry: delay, repeats = retry assert isinstance(repeats, int) assert repeats > 0 self.args = { 'mode': mode, 'retry': retry, }
def start(self): self.args['workdir'] = self.workdir self.args['logEnviron'] = self.logEnviron self.args['env'] = self.env self.args['timeout'] = self.timeout Source.start(self)
def __init__(self, p4base=None, defaultBranch=None, p4port=None, p4user=None, p4passwd=None, p4extra_views=[], p4line_end='local', p4client='buildbot_%(slave)s_%(builder)s', **kwargs): """ @type p4base: string @param p4base: A view into a perforce depot, typically "//depot/proj/" @type defaultBranch: string @param defaultBranch: Identify a branch to build by default. Perforce is a view based branching system. So, the branch is normally the name after the base. For example, branch=1.0 is view=//depot/proj/1.0/... branch=1.1 is view=//depot/proj/1.1/... @type p4port: string @param p4port: Specify the perforce server to connection in the format <host>:<port>. Example "perforce.example.com:1666" @type p4user: string @param p4user: The perforce user to run the command as. @type p4passwd: string @param p4passwd: The password for the perforce user. @type p4extra_views: list of tuples @param p4extra_views: Extra views to be added to the client that is being used. @type p4line_end: string @param p4line_end: value of the LineEnd client specification property @type p4client: string @param p4client: The perforce client to use for this buildslave. """ self.p4base = _ComputeRepositoryURL(p4base) self.branch = defaultBranch Source.__init__(self, **kwargs) self.addFactoryArguments( p4base=p4base, defaultBranch=defaultBranch, p4port=p4port, p4user=p4user, p4passwd=p4passwd, p4extra_views=p4extra_views, p4line_end=p4line_end, p4client=p4client, ) self.args['p4port'] = p4port self.args['p4user'] = p4user self.args['p4passwd'] = p4passwd self.args['p4extra_views'] = p4extra_views self.args['p4line_end'] = p4line_end self.p4client = p4client
def __init__(self, svnurl=None, baseURL=None, defaultBranch=None, directory=None, username=None, password=None, extra_args=None, keep_on_purge=None, ignore_ignores=None, always_purge=None, depth=None, **kwargs): """ @type svnurl: string @param svnurl: the URL which points to the Subversion server, combining the access method (HTTP, ssh, local file), the repository host/port, the repository path, the sub-tree within the repository, and the branch to check out. Use exactly one of C{svnurl} and C{baseURL}. @param baseURL: if branches are enabled, this is the base URL to which a branch name will be appended. It should probably end in a slash. Use exactly one of C{svnurl} and C{baseURL}. @param defaultBranch: if branches are enabled, this is the branch to use if the Build does not specify one explicitly. It will simply be appended to C{baseURL} and the result handed to the SVN command. @type username: string @param username: username to pass to svn's --username @type password: string @param password: password to pass to svn's --password """ if not 'workdir' in kwargs and directory is not None: # deal with old configs warn("Please use workdir=, not directory=", DeprecationWarning) kwargs['workdir'] = directory self.svnurl = svnurl and _ComputeRepositoryURL(svnurl) self.baseURL = _ComputeRepositoryURL(baseURL) self.branch = defaultBranch self.username = username self.password = password self.extra_args = extra_args self.keep_on_purge = keep_on_purge self.ignore_ignores = ignore_ignores self.always_purge = always_purge self.depth = depth Source.__init__(self, **kwargs) self.addFactoryArguments( svnurl=svnurl, baseURL=baseURL, defaultBranch=defaultBranch, directory=directory, username=username, password=password, extra_args=extra_args, keep_on_purge=keep_on_purge, ignore_ignores=ignore_ignores, always_purge=always_purge, depth=depth, ) if svnurl and baseURL: raise ValueError("you must use either svnurl OR baseURL")
def __init__(self, repourl=None, branch='HEAD', mode='incremental', method=None, reference=None, submodules=False, shallow=False, progress=False, retryFetch=False, clobberOnFailure=False, getDescription=False, config=None, **kwargs): """ @type repourl: string @param repourl: the URL which points at the git repository @type branch: string @param branch: The branch or tag to check out by default. If a build specifies a different branch, it will be used instead of this. @type submodules: boolean @param submodules: Whether or not to update (and initialize) git submodules. @type mode: string @param mode: Type of checkout. Described in docs. @type method: string @param method: Full builds can be done is different ways. This parameter specifies which method to use. @type reference: string @param reference: If available use a reference repo. Uses `--reference` in git command. Refer `git clone --help` @type progress: boolean @param progress: Pass the --progress option when fetching. This can solve long fetches getting killed due to lack of output, but requires Git 1.7.2+. @type shallow: boolean @param shallow: Use a shallow or clone, if possible @type retryFetch: boolean @param retryFetch: Retry fetching before failing source checkout. @type getDescription: boolean or dict @param getDescription: Use 'git describe' to describe the fetched revision @type config: dict @param config: Git configuration options to enable when running git """ if not getDescription and not isinstance(getDescription, dict): getDescription = False self.branch = branch self.method = method self.prog = progress self.repourl = repourl self.reference = reference self.retryFetch = retryFetch self.submodules = submodules self.shallow = shallow self.fetchcount = 0 self.clobberOnFailure = clobberOnFailure self.mode = mode self.getDescription = getDescription self.config = config self.supportsBranch = True self.srcdir = 'source' Source.__init__(self, **kwargs) if self.mode not in ['incremental', 'full']: bbconfig.error("Git: mode must be 'incremental' or 'full'.") if not self.repourl: bbconfig.error("Git: must provide repourl.") if (self.mode == 'full' and self.method not in ['clean', 'fresh', 'clobber', 'copy', None]): bbconfig.error("Git: invalid method for mode 'full'.") if self.shallow and (self.mode != 'full' or self.method != 'clobber'): bbconfig.error("Git: shallow only possible with mode 'full' and method 'clobber'.") if not isinstance(self.getDescription, (bool, dict)): bbconfig.error("Git: getDescription must be a boolean or a dict.")
def __init__(self, repourl=None, branch='HEAD', mode='incremental', method=None, submodules=False, shallow=False, progress=False, retryFetch=False, clobberOnFailure=False, getDescription=False, workdir='build', layername=None, storedir="/tmp/junk", mirrordir=None, config=None, **kwargs): """ @type repourl: string @param repourl: the URL which points at the git repository @type branch: string @param branch: The branch or tag to check out by default. If a build specifies a different branch, it will be used instead of this. @type submodules: boolean @param submodules: Whether or not to update (and initialize) git submodules. @type mode: string @param mode: Type of checkout. Described in docs. @type method: string @param method: Full builds can be done is different ways. This parameter specifies which method to use. @type progress: boolean @param progress: Pass the --progress option when fetching. This can solve long fetches getting killed due to lack of output, but requires Git 1.7.2+. @type shallow: boolean @param shallow: Use a shallow or clone, if possible @type retryFetch: boolean @param retryFetch: Retry fetching before failing source checkout. @type getDescription: boolean or dict @param getDescription: Use 'git describe' to describe the fetched revision @type workdir: string @param workdir: Used to indicate the destination of the copy of srcdir @type storedir: string @param storedir: where the old build dir gets moved to during a movecopy @type layername: string @param layername: Used in the yocto-autobuilder's movecopy as a way of moving the old build directory to a unique area for outside cleanup/ review. @type config: dict @param config: Git configuration options to enable when running git """ if not getDescription and not isinstance(getDescription, dict): getDescription = False self.branch = branch self.method = method self.prog = progress self.repourl = repourl.rstrip('/') self.retryFetch = retryFetch self.submodules = submodules self.shallow = shallow self.workdir = workdir self.storedir = storedir self.mirrordir = mirrordir self.layername = layername self.fetchcount = 0 self.clobberOnFailure = clobberOnFailure self.mode = mode self.getDescription = getDescription self.config = config self.timeout = 10*60 # We no longer pass srcdir in. There are way too many ways to hang # yourself by doing that. if self.mirrordir: if self.method in ['barecopy', 'movecopy']: self.srcdir='source/'+self.repourl else: if "poky" in self.layername or \ "oecore" in self.layername or \ "eclipse" in self.layername: self.srcdir = "build" else: self.srcdir = 'build/'+self.layername else: self.srcdir = 'source' if self.method in ['barecopy', 'movecopy']: self.workdir='source/'+self.repourl else: self.workdir = 'build' Source.__init__(self, **kwargs) if self.mode not in ['incremental', 'full']: bbconfig.error("Git: mode must be 'incremental' or 'full'.") if not self.repourl: bbconfig.error("Git: must provide repourl.") if (self.mode == 'full' and self.method not in ['clean', 'fresh', 'clobber', 'movecopy', 'barecopy', None]): bbconfig.error("Git: invalid method for mode 'full'.") if self.shallow and (self.mode != 'full' or self.method != 'clobber'): bbconfig.error("Git: shallow only possible with mode 'full' and method 'clobber'.") if not isinstance(self.getDescription, (bool, dict)): bbconfig.error("Git: getDescription must be a boolean or a dict.")
def __init__(self, repourl=None, branch='HEAD', mode='incremental', method=None, reference=None, submodules=False, shallow=False, progress=False, retryFetch=False, clobberOnFailure=False, getDescription=False, config=None, origin=None, **kwargs): """ @type repourl: string @param repourl: the URL which points at the git repository @type branch: string @param branch: The branch or tag to check out by default. If a build specifies a different branch, it will be used instead of this. @type submodules: boolean @param submodules: Whether or not to update (and initialize) git submodules. @type mode: string @param mode: Type of checkout. Described in docs. @type method: string @param method: Full builds can be done is different ways. This parameter specifies which method to use. @type reference: string @param reference: If available use a reference repo. Uses `--reference` in git command. Refer `git clone --help` @type progress: boolean @param progress: Pass the --progress option when fetching. This can solve long fetches getting killed due to lack of output, but requires Git 1.7.2+. @type shallow: boolean or integer @param shallow: Use a shallow or clone, if possible @type retryFetch: boolean @param retryFetch: Retry fetching before failing source checkout. @type getDescription: boolean or dict @param getDescription: Use 'git describe' to describe the fetched revision @type origin: string @param origin: The name to give the remote when cloning (default None) @type config: dict @param config: Git configuration options to enable when running git """ if not getDescription and not isinstance(getDescription, dict): getDescription = False self.branch = branch self.method = method self.prog = progress self.repourl = repourl self.reference = reference self.retryFetch = retryFetch self.submodules = submodules self.shallow = shallow self.clobberOnFailure = clobberOnFailure self.mode = mode self.getDescription = getDescription self.config = config self.supportsBranch = True self.supportsSubmoduleCheckout = True self.srcdir = 'source' self.origin = origin Source.__init__(self, **kwargs) if not self.repourl: bbconfig.error("Git: must provide repourl.") if isinstance(self.mode, string_types): if not self._hasAttrGroupMember('mode', self.mode): bbconfig.error( "Git: mode must be %s" % (' or '.join(self._listAttrGroupMembers('mode')))) if isinstance(self.method, string_types): if (self.mode == 'full' and self.method not in ['clean', 'fresh', 'clobber', 'copy', None]): bbconfig.error("Git: invalid method for mode 'full'.") if self.shallow and (self.mode != 'full' or self.method != 'clobber'): bbconfig.error( "Git: shallow only possible with mode 'full' and method 'clobber'." ) if not isinstance(self.getDescription, (bool, dict)): bbconfig.error("Git: getDescription must be a boolean or a dict.")
def __init__(self, repourl=None, branch='HEAD', mode='incremental', method=None, reference=None, submodules=False, shallow=False, progress=False, retryFetch=False, clobberOnFailure=False, getDescription=False, config=None, origin=None, sshPrivateKey=None, sshHostKey=None, **kwargs): """ @type repourl: string @param repourl: the URL which points at the git repository @type branch: string @param branch: The branch or tag to check out by default. If a build specifies a different branch, it will be used instead of this. @type submodules: boolean @param submodules: Whether or not to update (and initialize) git submodules. @type mode: string @param mode: Type of checkout. Described in docs. @type method: string @param method: Full builds can be done is different ways. This parameter specifies which method to use. @type reference: string @param reference: If available use a reference repo. Uses `--reference` in git command. Refer `git clone --help` @type progress: boolean @param progress: Pass the --progress option when fetching. This can solve long fetches getting killed due to lack of output, but requires Git 1.7.2+. @type shallow: boolean or integer @param shallow: Use a shallow or clone, if possible @type retryFetch: boolean @param retryFetch: Retry fetching before failing source checkout. @type getDescription: boolean or dict @param getDescription: Use 'git describe' to describe the fetched revision @type origin: string @param origin: The name to give the remote when cloning (default None) @type sshPrivateKey: Secret or string @param sshPrivateKey: The private key to use when running git for fetch operations. The ssh utility must be in the system path in order to use this option. On Windows only git distribution that embeds MINGW has been tested (as of July 2017 the official distribution is MINGW-based). @type sshHostKey: Secret or string @param sshHostKey: Specifies public host key to match when authenticating with SSH public key authentication. `sshPrivateKey` must be specified in order to use this option. The host key must be in the form of `<key type> <base64-encoded string>`, e.g. `ssh-rsa AAAAB3N<...>FAaQ==`. @type config: dict @param config: Git configuration options to enable when running git """ if not getDescription and not isinstance(getDescription, dict): getDescription = False self.branch = branch self.method = method self.prog = progress self.repourl = repourl self.reference = reference self.retryFetch = retryFetch self.submodules = submodules self.shallow = shallow self.clobberOnFailure = clobberOnFailure self.mode = mode self.getDescription = getDescription self.sshPrivateKey = sshPrivateKey self.sshHostKey = sshHostKey self.config = config self.srcdir = 'source' self.origin = origin Source.__init__(self, **kwargs) self.setupGitStep() if isinstance(self.mode, string_types): if not self._hasAttrGroupMember('mode', self.mode): bbconfig.error("Git: mode must be %s" % (' or '.join(self._listAttrGroupMembers('mode')))) if isinstance(self.method, string_types): if (self.mode == 'full' and self.method not in ['clean', 'fresh', 'clobber', 'copy', None]): bbconfig.error("Git: invalid method for mode 'full'.") if self.shallow and (self.mode != 'full' or self.method != 'clobber'): bbconfig.error( "Git: shallow only possible with mode 'full' and method 'clobber'.") if not isinstance(self.getDescription, (bool, dict)): bbconfig.error("Git: getDescription must be a boolean or a dict.")