From ac4e14770fc04db02be2f48f6de675e90e3f6b29 Mon Sep 17 00:00:00 2001 From: Paul Allen Date: Fri, 20 Jun 2014 11:45:58 +0100 Subject: Moved p4.markdown content to project's markdown --- README.markdown | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) (limited to 'README.markdown') diff --git a/README.markdown b/README.markdown index 39cd249..6dc36d2 100644 --- a/README.markdown +++ b/README.markdown @@ -13,6 +13,7 @@ * [CVS](#cvs) * [Git](#git) * [Mercurial](#mercurial) + * [Perforce](#perforce) * [Subversion](#subversion) 5. [Reference - An under-the-hood peek at what the module is doing and how](#reference) * [Type: vcsrepo](#type-vcsrepo) @@ -57,6 +58,7 @@ The vcsrepo module works with the following VCSs: * [CVS (cvs)](#cvs) * [Git (git)](#git) * [Mercurial (hg)](#mercurial) +* [Perforce (p4)](#perforce) * [Subversion (svn)](#subversion) ###Bazaar @@ -314,6 +316,96 @@ When your source uses SSH, such as 'ssh://...', you can manage your SSH keys wit For more examples using Mercurial, see `examples/hg/`. +###Perforce + +#####To create an empty Workspace + +To create an empty Workspace, define a `vcsrepo` without a `source` or `revision`. The +Environment variables P4PORT, P4USER, etc... are used to define the Perforce server +connection settings. + + 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. The +value replaces the P4CLIENT environment variable. + + 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' + } + +You can set `p4passwd` for authentication : + + vcsrepo { "/path/to/repo": + ensure => present, + provider => p4, + source => '//depot/branch/...', + p4port => 'ssl:perforce.com:1666' + } + +If `p4port`, `p4user`, `p4charset`, `p4passwd` 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. + +#####Further Examples + +For examples you can run, see `examples/p4/` + ###Subversion #####To create a blank repository -- cgit v1.2.3 From 319f9fbe1954fd172da638f3ccd76e58c3ec8c7f Mon Sep 17 00:00:00 2001 From: Paul Allen Date: Mon, 23 Jun 2014 15:51:28 +0100 Subject: Added support for p4config. - Removed p4port, p4client, p4user to keep name space clean. - Changed notify to Puppet.debug - Updated markdown and examples - Updated unit tests --- README.markdown | 45 ++++++++++----------------------------------- 1 file changed, 10 insertions(+), 35 deletions(-) (limited to 'README.markdown') diff --git a/README.markdown b/README.markdown index 6dc36d2..5f8aa9d 100644 --- a/README.markdown +++ b/README.markdown @@ -329,18 +329,19 @@ connection settings. provider => p4 } -If no `p4client` name is provided a workspace generated name is calculated based on the -Digest of path. For example: +If no `P4CLIENT` environment 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. The -value replaces the P4CLIENT environment variable. +A Perforce configuration file can be used by setting the `P4CONFIG` environment or +defining `p4config`. If a configuration is defined, then the environment variable for +`P4CLIENT` is replaced. vcsrepo { "/path/to/repo": ensure => present, - provider => p4 - p4client => "my_client_ws" + provider => p4, + p4config => '.p4config' } #####To create/update and sync a Perforce workspace @@ -371,36 +372,10 @@ You can also set `revision` to a label: 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' - } - -You can set `p4passwd` for authentication : - - vcsrepo { "/path/to/repo": - ensure => present, - provider => p4, - source => '//depot/branch/...', - p4port => 'ssl:perforce.com:1666' - } +#####To authenticate against the Perforce server -If `p4port`, `p4user`, `p4charset`, `p4passwd` 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. +Either set the environment variables `P4USER` and `P4PASSWD` or use a configuration file. +For secure servers set the `P4PASSWD` with a valid ticket generated using `p4 login -p`. #####Further Examples -- cgit v1.2.3 From 457035ec1c15df0d53abf7232dad63b2722b1720 Mon Sep 17 00:00:00 2001 From: Paul Allen Date: Mon, 23 Jun 2014 16:22:35 +0100 Subject: Add hostname to Digest for default client name. --- README.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README.markdown') diff --git a/README.markdown b/README.markdown index 5f8aa9d..575950c 100644 --- a/README.markdown +++ b/README.markdown @@ -330,7 +330,7 @@ connection settings. } If no `P4CLIENT` environment name is provided a workspace generated name is calculated -based on the Digest of path. For example: +based on the Digest of path and hostname. For example: puppet-91bc00640c4e5a17787286acbe2c021c -- cgit v1.2.3 From e1aa644dd075c275dd22d85cdc03c88dda029d87 Mon Sep 17 00:00:00 2001 From: Paul Allen Date: Tue, 24 Jun 2014 13:57:30 +0100 Subject: Support streams and fix Marshal for 'p4 cstat' --- README.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'README.markdown') diff --git a/README.markdown b/README.markdown index 575950c..d977886 100644 --- a/README.markdown +++ b/README.markdown @@ -346,15 +346,15 @@ defining `p4config`. If a configuration is defined, then the environment variab #####To create/update and sync a Perforce workspace -To sync a depot path to head (latest): +To sync a depot path to head, ensure `latest`: vcsrepo { "/path/to/repo": - ensure => present, + ensure => latest, provider => p4, source => '//depot/branch/...' } -For a specific changelist, use `revision`: +For a specific changelist, ensure `present` and specify a `revision`: vcsrepo { "/path/to/repo": ensure => present, -- cgit v1.2.3