summaryrefslogtreecommitdiff
path: root/README.P4.markdown
blob: 39fffd2a6dade18c9296f6efe39d0b0b638040f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
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/`