From b16e4c0f9251279fe2211f651459654e0759dbf0 Mon Sep 17 00:00:00 2001 From: Paul Allen Date: Thu, 12 Jun 2014 17:49:19 +0100 Subject: Markdown and examples --- README.P4.markdown | 82 ++++++++++++++++++++++++++++++++++++++++++++ examples/p4/create_client.pp | 5 +++ examples/p4/delete_client.pp | 5 +++ examples/p4/latest_client.pp | 6 ++++ examples/p4/sync_client.pp | 7 ++++ 5 files changed, 105 insertions(+) create mode 100644 README.P4.markdown create mode 100644 examples/p4/create_client.pp create mode 100644 examples/p4/delete_client.pp create mode 100644 examples/p4/latest_client.pp create mode 100644 examples/p4/sync_client.pp diff --git a/README.P4.markdown b/README.P4.markdown new file mode 100644 index 0000000..39fffd2 --- /dev/null +++ b/README.P4.markdown @@ -0,0 +1,82 @@ +Using vcsrepo with Perforce +=========================== + +To create an empty Workspace +---------------------------- + +Define a `vcsrepo` without a `source` or `revision`: + + vcsrepo { "/path/to/repo": + ensure => present, + provider => p4 + } + +If no `p4client` name is provided a workspace generated name is calculated based on the +Digest of path. For example: + + puppet-91bc00640c4e5a17787286acbe2c021c + +Providing a `p4client` name will create/update the client workspace in Perforce. + + vcsrepo { "/path/to/repo": + ensure => present, + provider => p4 + p4client => "my_client_ws" + } + +To create/update and sync a Perforce workspace +---------------------------------------------- + +To sync a depot path to head (latest): + + vcsrepo { "/path/to/repo": + ensure => present, + provider => p4, + source => '//depot/branch/...' + } + +For a specific changelist, use `revision`: + + vcsrepo { "/path/to/repo": + ensure => present, + provider => p4, + source => '//depot/branch/...', + revision => '2341' + } + +You can also set `revision` to a label: + + vcsrepo { "/path/to/repo": + ensure => present, + provider => p4, + source => '//depot/branch/...', + revision => 'my_label' + } + +Check out as a user by setting `p4user`: + + vcsrepo { "/path/to/repo": + ensure => present, + provider => p4, + source => '//depot/branch/...', + p4user => 'user' + } + +You can set `p4port` to specify a Perforce server: + + vcsrepo { "/path/to/repo": + ensure => present, + provider => p4, + source => '//depot/branch/...', + p4port => 'ssl:perforce.com:1666' + } + +If `p4port`, `p4user`, `p4charset` or `p4client` are specified they will override the +environment variabels P4PORT, P4USER, etc... If a P4CONFIG file is defined, the config +file settings will take precedence. + + +More Examples +------------- + +For examples you can run, see `examples/p4/` diff --git a/examples/p4/create_client.pp b/examples/p4/create_client.pp new file mode 100644 index 0000000..f7605e6 --- /dev/null +++ b/examples/p4/create_client.pp @@ -0,0 +1,5 @@ +vcsrepo { "/tmp/vcstest-p4-create_client": + ensure => present, + provider => p4, + p4client => "puppet-test001" +} \ No newline at end of file diff --git a/examples/p4/delete_client.pp b/examples/p4/delete_client.pp new file mode 100644 index 0000000..315222f --- /dev/null +++ b/examples/p4/delete_client.pp @@ -0,0 +1,5 @@ +vcsrepo { "/tmp/vcstest-p4-create_client": + ensure => absent, + provider => p4, + p4client => "puppet-test001" +} \ No newline at end of file diff --git a/examples/p4/latest_client.pp b/examples/p4/latest_client.pp new file mode 100644 index 0000000..719e180 --- /dev/null +++ b/examples/p4/latest_client.pp @@ -0,0 +1,6 @@ +vcsrepo { "/tmp/vcstest-p4-create_client": + ensure => latest, + provider => p4, + p4client => "puppet-test001", + source => "//depot/..." +} \ No newline at end of file diff --git a/examples/p4/sync_client.pp b/examples/p4/sync_client.pp new file mode 100644 index 0000000..c1128bc --- /dev/null +++ b/examples/p4/sync_client.pp @@ -0,0 +1,7 @@ +vcsrepo { "/tmp/vcstest-p4-create_client": + ensure => present, + provider => p4, + p4client => "puppet-test001", + source => "//depot/..." + revision => "30" +} \ No newline at end of file -- cgit v1.2.3