To get started with the vcsrepo module, you must simply define the type `vcsrepo` with a path to your repository and the [type of VCS](#Usage) you're using in `provider` (in the below example, Git).
- vcsrepo { "/path/to/repo":
+ vcsrepo { '/path/to/repo':
ensure => present,
provider => git,
}
To create a blank repository suitable for use as a central repository,
define `vcsrepo` without `source` or `revision`.
- vcsrepo { "/path/to/repo":
+ vcsrepo { '/path/to/repo':
ensure => present,
provider => git,
}
If you're defining `vcsrepo` for a central or official repository, you may want to make it a bare repository. You do this by setting `ensure` to 'bare' rather than 'present'.
- vcsrepo { "/path/to/repo":
+ vcsrepo { '/path/to/repo':
ensure => bare,
provider => git,
}
To get the current HEAD on the master branch,
- vcsrepo { "/path/to/repo":
+ vcsrepo { '/path/to/repo':
ensure => present,
provider => git,
- source => "git://example.com/repo.git",
+ source => 'git://example.com/repo.git',
}
To get a specific revision or branch (can be a commit SHA, tag, or branch name),
**SHA**
- vcsrepo { "/path/to/repo":
+ vcsrepo { '/path/to/repo':
ensure => present,
provider => git,
source => 'git://example.com/repo.git',
**Tag**
- vcsrepo { "/path/to/repo":
+ vcsrepo { '/path/to/repo':
ensure => present,
provider => git,
source => 'git://example.com/repo.git',
**Branch name**
- vcsrepo { "/path/to/repo":
+ vcsrepo { '/path/to/repo':
ensure => present,
provider => git,
source => 'git://example.com/repo.git',
To check out a branch as a specific user,
- vcsrepo { "/path/to/repo":
+ vcsrepo { '/path/to/repo':
ensure => present,
provider => git,
source => 'git://example.com/repo.git',
To keep the repository at the latest revision (**WARNING:** this will always overwrite local changes to the repository),
- vcsrepo { "/path/to/repo":
+ vcsrepo { '/path/to/repo':
ensure => latest,
provider => git,
source => 'git://example.com/repo.git',
To clone the repository but skip initialiazing submodules,
- vcsrepo { "/path/to/repo":
+ vcsrepo { '/path/to/repo':
ensure => latest,
provider => git,
source => 'git://example.com/repo.git',
##### Using multiple remotes with a repository
Instead of specifying a single string in the 'source' property, you can specify a hash with multiple name => URL mappings,
- vcsrepo { "/path/to/repo":
+ vcsrepo { '/path/to/repo':
ensure => present,
provider => git,
source => {
- "origin" => "https://github.com/puppetlabs/puppetlabs-vcsrepo.git",
- "other_remote" => "https://github.com/other_user/puppetlabs-vcsrepo.git"
+ origin => 'https://github.com/puppetlabs/puppetlabs-vcsrepo.git',
+ other_remote => 'https://github.com/other_user/puppetlabs-vcsrepo.git'
},
}
To create a blank repository suitable for use as a central repository,
define `vcsrepo` without `source` or `revision`.
- vcsrepo { "/path/to/repo":
+ vcsrepo { '/path/to/repo':
ensure => present,
provider => bzr,
}
Provide the `source` location to branch from an existing repository.
- vcsrepo { "/path/to/repo":
+ vcsrepo { '/path/to/repo':
ensure => present,
provider => bzr,
source => 'lp:myproj',
For a specific revision, use `revision` with a valid revisionspec
(see `bzr help revisionspec` for more information on formatting a revision).
- vcsrepo { "/path/to/repo":
+ vcsrepo { '/path/to/repo':
ensure => present,
provider => bzr,
source => 'lp:myproj',
To create a blank repository suitable for use as a central repository,
define `vcsrepo` without `source` or `revision`.
- vcsrepo { "/path/to/repo":
+ vcsrepo { '/path/to/repo':
ensure => present,
provider => cvs,
}
To get the current mainline,
- vcsrepo { "/path/to/workspace":
+ vcsrepo { '/path/to/workspace':
ensure => present,
provider => cvs,
- source => ":pserver:anonymous@example.com:/sources/myproj",
+ source => ':pserver:anonymous@example.com:/sources/myproj',
}
To get a specific module on the current mainline,
- vcsrepo {"/vagrant/lockss-daemon-source":
+ vcsrepo {'/vagrant/lockss-daemon-source':
ensure => present,
provider => cvs,
- source => ":pserver:anonymous@lockss.cvs.sourceforge.net:/cvsroot/lockss",
- module => "lockss-daemon",
+ source => ':pserver:anonymous@lockss.cvs.sourceforge.net:/cvsroot/lockss',
+ module => 'lockss-daemon',
}
You can use the `compression` parameter to set the GZIP compression levels for your repository history.
- vcsrepo { "/path/to/workspace":
+ vcsrepo { '/path/to/workspace':
ensure => present,
provider => cvs,
compression => 3,
- source => ":pserver:anonymous@example.com:/sources/myproj",
+ source => ':pserver:anonymous@example.com:/sources/myproj',
}
For a specific tag, use `revision`.
- vcsrepo { "/path/to/workspace":
+ vcsrepo { '/path/to/workspace':
ensure => present,
provider => cvs,
compression => 3,
- source => ":pserver:anonymous@example.com:/sources/myproj",
- revision => "SOMETAG",
+ source => ':pserver:anonymous@example.com:/sources/myproj',
+ revision => 'SOMETAG',
}
#####Sources that use SSH
To create a blank repository suitable for use as a central repository,
define `vcsrepo` without `source` or `revision`.
- vcsrepo { "/path/to/repo":
+ vcsrepo { '/path/to/repo':
ensure => present,
provider => hg,
}
To get the default branch tip,
- vcsrepo { "/path/to/repo":
+ vcsrepo { '/path/to/repo':
ensure => present,
provider => hg,
- source => "http://hg.example.com/myrepo",
+ source => 'http://hg.example.com/myrepo',
}
For a specific changeset, use `revision`.
- vcsrepo { "/path/to/repo":
+ vcsrepo { '/path/to/repo':
ensure => present,
provider => hg,
- source => "http://hg.example.com/myrepo",
+ source => 'http://hg.example.com/myrepo',
revision => '21ea4598c962',
}
You can also set `revision` to a tag.
- vcsrepo { "/path/to/repo":
+ vcsrepo { '/path/to/repo':
ensure => present,
provider => hg,
- source => "http://hg.example.com/myrepo",
+ source => 'http://hg.example.com/myrepo',
revision => '1.1.2',
}
To check out as a specific user,
- vcsrepo { "/path/to/repo":
+ vcsrepo { '/path/to/repo':
ensure => present,
provider => hg,
- source => "http://hg.example.com/myrepo",
+ source => 'http://hg.example.com/myrepo',
user => 'user',
}
To specify an SSH identity key,
- vcsrepo { "/path/to/repo":
+ vcsrepo { '/path/to/repo':
ensure => present,
provider => hg,
- source => "ssh://hg@hg.example.com/myrepo",
- identity => "/home/user/.ssh/id_dsa,
+ source => 'ssh://hg@hg.example.com/myrepo',
+ identity => '/home/user/.ssh/id_dsa',
}
To specify a username and password for HTTP Basic authentication,
- vcsrepo { "/path/to/repo":
+ vcsrepo { '/path/to/repo':
ensure => latest,
provider => hg,
source => 'http://hg.example.com/myrepo',
Environment variables P4PORT, P4USER, etc... are used to define the Perforce server
connection settings.
- vcsrepo { "/path/to/repo":
+ vcsrepo { '/path/to/repo':
ensure => present,
provider => p4
}
defining `p4config`. If a configuration is defined, then the environment variable for
`P4CLIENT` is replaced.
- vcsrepo { "/path/to/repo":
+ vcsrepo { '/path/to/repo':
ensure => present,
provider => p4,
p4config => '.p4config'
To sync a depot path to head, ensure `latest`:
- vcsrepo { "/path/to/repo":
+ vcsrepo { '/path/to/repo':
ensure => latest,
provider => p4,
source => '//depot/branch/...'
For a specific changelist, ensure `present` and specify a `revision`:
- vcsrepo { "/path/to/repo":
+ vcsrepo { '/path/to/repo':
ensure => present,
provider => p4,
source => '//depot/branch/...',
You can also set `revision` to a label:
- vcsrepo { "/path/to/repo":
+ vcsrepo { '/path/to/repo':
ensure => present,
provider => p4,
source => '//depot/branch/...',
To create a blank repository suitable for use as a central repository,
define `vcsrepo` without `source` or `revision`.
- vcsrepo { "/path/to/repo":
+ vcsrepo { '/path/to/repo':
ensure => present,
provider => svn,
}
Provide a `source` pointing to the branch/tag you want to check out from a repository.
- vcsrepo { "/path/to/repo":
+ vcsrepo { '/path/to/repo':
ensure => present,
provider => svn,
- source => "svn://svnrepo/hello/branches/foo",
+ source => 'svn://svnrepo/hello/branches/foo',
}
You can also provide a specific revision.
- vcsrepo { "/path/to/repo":
+ vcsrepo { '/path/to/repo':
ensure => present,
provider => svn,
- source => "svn://svnrepo/hello/branches/foo",
+ source => 'svn://svnrepo/hello/branches/foo',
revision => '1234',
}
To use a specific configuration directory, provide a `configuration` parameter which should be a directory path on the local system where your svn configuration files are. Typically, it is '/path/to/.subversion'.
- vcsrepo { "/path/to/repo":
+ vcsrepo { '/path/to/repo':
ensure => present,
provider => svn,
- source => "svn://svnrepo/hello/branches/foo",
- configuration => "/path/to/.subversion",
+ source => 'svn://svnrepo/hello/branches/foo',
+ configuration => '/path/to/.subversion',
}
#####Sources that use SSH