vcs Package¶
vcs
Package¶
Roles in this namespace relate to Version Control Systems support in Debian distributions, such as git, svn or mercurial.
git
Module¶
Roles in this namespace are meant to provide Git repository creation operations within Debian distributions.
-
class
provy.more.debian.vcs.git.
GitRole
(prov, context)[source]¶ Bases:
provy.core.roles.Role
This role provides utility methods for Git repositories management within Debian distributions.
Example:
from provy.core import Role from provy.more.debian import GitRole class MySampleRole(Role): def provision(self): with self.using(GitRole) as role: role.ensure_repository('git://github.com/python-provy/provy.git', '/home/user/provy', owner='user', branch='some-branch')
-
ensure_repository
(repo, path, owner=None, branch=None, sudo=True)[source]¶ Makes sure the repository is create in the remote server. This method does not update the repository or perform any operations in it. It is merely used to ensure that the repository exists in the specified path.
Parameters: - repo (
str
) – Git repository url. - path (
str
) – Path to create the local repository. - owner (
str
) – User that owns the repository directory. Defaults toNone
, using the current one in the remote server. - branch (
str
) – If specified, the given branch will be checked-out, otherwise it stays in the master branch. - sudo (
bool
) – IfFalse
, won’t sudo when creating the repository. Defaults toTrue
.
Example:
from provy.core import Role from provy.more.debian import GitRole class MySampleRole(Role): def provision(self): with self.using(GitRole) as role: role.ensure_repository('git://github.com/python-provy/provy.git', '/home/user/provy', owner='user', branch='some-branch')
- repo (
-