Skip to content

Commit 15d0d3c

Browse files
Merge pull request #586 from jcpunk/install-scm
Add classes to manage supported SCM packages
2 parents f7be89e + 934332e commit 15d0d3c

File tree

9 files changed

+303
-93
lines changed

9 files changed

+303
-93
lines changed

.rubocop_todo.yml

+11-26
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2023-04-19 11:23:36 UTC using RuboCop version 1.48.1.
3+
# on 2023-05-02 15:02:35 UTC using RuboCop version 1.48.1.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
@@ -31,10 +31,10 @@ Metrics/BlockLength:
3131
Metrics/CyclomaticComplexity:
3232
Max: 12
3333

34-
# Offense count: 43
34+
# Offense count: 38
3535
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
3636
Metrics/MethodLength:
37-
Max: 31
37+
Max: 28
3838

3939
# Offense count: 8
4040
# Configuration parameters: AllowedMethods, AllowedPatterns.
@@ -46,36 +46,19 @@ Naming/AccessorMethodName:
4646
Exclude:
4747
- 'lib/puppet/type/vcsrepo.rb'
4848

49-
# Offense count: 1
49+
# Offense count: 6
5050
# Configuration parameters: Prefixes, AllowedPatterns.
5151
# Prefixes: when, with, without
5252
RSpec/ContextWording:
5353
Exclude:
54+
- 'spec/classes/manage/git_spec.rb'
55+
- 'spec/classes/manage/svn_spec.rb'
5456
- 'spec/unit/puppet/provider/vcsrepo/git_spec.rb'
5557

56-
# Offense count: 15
58+
# Offense count: 25
5759
# Configuration parameters: IgnoredMetadata.
5860
RSpec/DescribeClass:
59-
Exclude:
60-
- '**/spec/features/**/*'
61-
- '**/spec/requests/**/*'
62-
- '**/spec/routing/**/*'
63-
- '**/spec/system/**/*'
64-
- '**/spec/views/**/*'
65-
- 'spec/acceptance/clone_repo_spec.rb'
66-
- 'spec/acceptance/create_repo_spec.rb'
67-
- 'spec/acceptance/multiple_remotes_spec.rb'
68-
- 'spec/acceptance/remove_repo_spec.rb'
69-
- 'spec/acceptance/revision_spec.rb'
70-
- 'spec/acceptance/svn_paths_spec.rb'
71-
- 'spec/acceptance/svn_spec.rb'
72-
- 'spec/unit/puppet/provider/vcsrepo/bzr_spec.rb'
73-
- 'spec/unit/puppet/provider/vcsrepo/cvs_spec.rb'
74-
- 'spec/unit/puppet/provider/vcsrepo/git_spec.rb'
75-
- 'spec/unit/puppet/provider/vcsrepo/hg_spec.rb'
76-
- 'spec/unit/puppet/provider/vcsrepo/p4_spec.rb'
77-
- 'spec/unit/puppet/provider/vcsrepo/svn_spec.rb'
78-
- 'spec/unit/puppet/type/vcsrepo_spec.rb'
61+
Enabled: false
7962

8063
# Offense count: 43
8164
# Configuration parameters: CountAsOne.
@@ -101,13 +84,15 @@ RSpec/MultipleMemoizedHelpers:
10184
RSpec/NestedGroups:
10285
Max: 4
10386

104-
# Offense count: 55
87+
# Offense count: 60
10588
# Configuration parameters: AllowedPatterns.
10689
# AllowedPatterns: ^expect_, ^assert_
10790
RSpec/NoExpectationExample:
10891
Exclude:
10992
- 'spec/acceptance/clone_repo_spec.rb'
11093
- 'spec/acceptance/create_repo_spec.rb'
94+
- 'spec/acceptance/manage/git_spec.rb'
95+
- 'spec/acceptance/manage/svn_spec.rb'
11196
- 'spec/acceptance/multiple_remotes_spec.rb'
11297
- 'spec/acceptance/remove_repo_spec.rb'
11398
- 'spec/acceptance/revision_spec.rb'

REFERENCE.md

+139-62
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,87 @@
44

55
## Table of Contents
66

7+
### Classes
8+
9+
* [`vcsrepo::manage::git`](#vcsrepomanagegit): Manage the Git source code manager package
10+
* [`vcsrepo::manage::svn`](#vcsrepomanagesvn): Manage the Subversion source code manager package
11+
712
### Resource types
813

914
* [`vcsrepo`](#vcsrepo): A local version control repository
1015

16+
## Classes
17+
18+
### <a name="vcsrepomanagegit"></a>`vcsrepo::manage::git`
19+
20+
Manage the Git source code manager package
21+
22+
#### Examples
23+
24+
##### simple include
25+
26+
```puppet
27+
include vcsrepo::manage::git
28+
```
29+
30+
#### Parameters
31+
32+
The following parameters are available in the `vcsrepo::manage::git` class:
33+
34+
* [`package_name`](#package_name)
35+
* [`package_ensure`](#package_ensure)
36+
37+
##### <a name="package_name"></a>`package_name`
38+
39+
Data type: `Variant[String[1], Array[String[1]]]`
40+
41+
name of package to manage
42+
43+
Default value: `'git'`
44+
45+
##### <a name="package_ensure"></a>`package_ensure`
46+
47+
Data type: `String[1]`
48+
49+
ensure state of the package resource
50+
51+
Default value: `'installed'`
52+
53+
### <a name="vcsrepomanagesvn"></a>`vcsrepo::manage::svn`
54+
55+
Manage the Subversion source code manager package
56+
57+
#### Examples
58+
59+
##### simple include
60+
61+
```puppet
62+
include vcsrepo::manage::svn
63+
```
64+
65+
#### Parameters
66+
67+
The following parameters are available in the `vcsrepo::manage::svn` class:
68+
69+
* [`package_name`](#package_name)
70+
* [`package_ensure`](#package_ensure)
71+
72+
##### <a name="package_name"></a>`package_name`
73+
74+
Data type: `Variant[String[1], Array[String[1]]]`
75+
76+
name of package to manage
77+
78+
Default value: `'subversion'`
79+
80+
##### <a name="package_ensure"></a>`package_ensure`
81+
82+
Data type: `String[1]`
83+
84+
ensure state of the package resource
85+
86+
Default value: `'installed'`
87+
1188
## Resource types
1289

1390
### <a name="vcsrepo"></a>`vcsrepo`
@@ -40,7 +117,7 @@ The revision of the repository
40117

41118
##### `skip_hooks`
42119

43-
Valid values: `true`, `false`
120+
Valid values: ``true``, ``false``
44121

45122
Explicitly skip any global hooks for this repository.
46123

@@ -52,154 +129,154 @@ The source URI for the repository
52129

53130
The following parameters are available in the `vcsrepo` type.
54131

55-
* [`basic_auth_password`](#-vcsrepo--basic_auth_password)
56-
* [`basic_auth_username`](#-vcsrepo--basic_auth_username)
57-
* [`branch`](#-vcsrepo--branch)
58-
* [`compression`](#-vcsrepo--compression)
59-
* [`configuration`](#-vcsrepo--configuration)
60-
* [`conflict`](#-vcsrepo--conflict)
61-
* [`cvs_rsh`](#-vcsrepo--cvs_rsh)
62-
* [`depth`](#-vcsrepo--depth)
63-
* [`excludes`](#-vcsrepo--excludes)
64-
* [`force`](#-vcsrepo--force)
65-
* [`fstype`](#-vcsrepo--fstype)
66-
* [`group`](#-vcsrepo--group)
67-
* [`http_proxy`](#-vcsrepo--http_proxy)
68-
* [`identity`](#-vcsrepo--identity)
69-
* [`keep_local_changes`](#-vcsrepo--keep_local_changes)
70-
* [`owner`](#-vcsrepo--owner)
71-
* [`p4config`](#-vcsrepo--p4config)
72-
* [`path`](#-vcsrepo--path)
73-
* [`provider`](#-vcsrepo--provider)
74-
* [`remote`](#-vcsrepo--remote)
75-
* [`safe_directory`](#-vcsrepo--safe_directory)
76-
* [`submodules`](#-vcsrepo--submodules)
77-
* [`trust_server_cert`](#-vcsrepo--trust_server_cert)
78-
* [`umask`](#-vcsrepo--umask)
79-
* [`user`](#-vcsrepo--user)
80-
81-
##### <a name="-vcsrepo--basic_auth_password"></a>`basic_auth_password`
132+
* [`basic_auth_password`](#basic_auth_password)
133+
* [`basic_auth_username`](#basic_auth_username)
134+
* [`branch`](#branch)
135+
* [`compression`](#compression)
136+
* [`configuration`](#configuration)
137+
* [`conflict`](#conflict)
138+
* [`cvs_rsh`](#cvs_rsh)
139+
* [`depth`](#depth)
140+
* [`excludes`](#excludes)
141+
* [`force`](#force)
142+
* [`fstype`](#fstype)
143+
* [`group`](#group)
144+
* [`http_proxy`](#http_proxy)
145+
* [`identity`](#identity)
146+
* [`keep_local_changes`](#keep_local_changes)
147+
* [`owner`](#owner)
148+
* [`p4config`](#p4config)
149+
* [`path`](#path)
150+
* [`provider`](#provider)
151+
* [`remote`](#remote)
152+
* [`safe_directory`](#safe_directory)
153+
* [`submodules`](#submodules)
154+
* [`trust_server_cert`](#trust_server_cert)
155+
* [`umask`](#umask)
156+
* [`user`](#user)
157+
158+
##### <a name="basic_auth_password"></a>`basic_auth_password`
82159

83160
HTTP Basic Auth password
84161

85-
##### <a name="-vcsrepo--basic_auth_username"></a>`basic_auth_username`
162+
##### <a name="basic_auth_username"></a>`basic_auth_username`
86163

87164
HTTP Basic Auth username
88165

89-
##### <a name="-vcsrepo--branch"></a>`branch`
166+
##### <a name="branch"></a>`branch`
90167

91168
The name of the branch to clone.
92169

93-
##### <a name="-vcsrepo--compression"></a>`compression`
170+
##### <a name="compression"></a>`compression`
94171

95172
Compression level
96173

97-
##### <a name="-vcsrepo--configuration"></a>`configuration`
174+
##### <a name="configuration"></a>`configuration`
98175

99176
The configuration directory to use
100177

101-
##### <a name="-vcsrepo--conflict"></a>`conflict`
178+
##### <a name="conflict"></a>`conflict`
102179

103180
The action to take if conflicts exist between repository and working copy
104181

105-
##### <a name="-vcsrepo--cvs_rsh"></a>`cvs_rsh`
182+
##### <a name="cvs_rsh"></a>`cvs_rsh`
106183

107184
The value to be used for the CVS_RSH environment variable.
108185

109-
##### <a name="-vcsrepo--depth"></a>`depth`
186+
##### <a name="depth"></a>`depth`
110187

111188
The value to be used to do a shallow clone.
112189

113-
##### <a name="-vcsrepo--excludes"></a>`excludes`
190+
##### <a name="excludes"></a>`excludes`
114191

115192
Local paths which shouldn't be tracked by the repository
116193

117-
##### <a name="-vcsrepo--force"></a>`force`
194+
##### <a name="force"></a>`force`
118195

119-
Valid values: `true`, `false`, `yes`, `no`
196+
Valid values: ``true``, ``false``, `yes`, `no`
120197

121198
Force repository creation, destroying any files on the path in the process.
122199

123-
Default value: `false`
200+
Default value: ``false``
124201

125-
##### <a name="-vcsrepo--fstype"></a>`fstype`
202+
##### <a name="fstype"></a>`fstype`
126203

127204
Filesystem type
128205

129-
##### <a name="-vcsrepo--group"></a>`group`
206+
##### <a name="group"></a>`group`
130207

131208
The group/gid that owns the repository files
132209

133-
##### <a name="-vcsrepo--http_proxy"></a>`http_proxy`
210+
##### <a name="http_proxy"></a>`http_proxy`
134211

135212
Sets the HTTP/HTTPS proxy for remote repo access
136213

137-
##### <a name="-vcsrepo--identity"></a>`identity`
214+
##### <a name="identity"></a>`identity`
138215

139216
SSH identity file
140217

141-
##### <a name="-vcsrepo--keep_local_changes"></a>`keep_local_changes`
218+
##### <a name="keep_local_changes"></a>`keep_local_changes`
142219

143-
Valid values: `true`, `false`
220+
Valid values: ``true``, ``false``
144221

145222
Keep local changes on files tracked by the repository when changing revision
146223

147-
Default value: `false`
224+
Default value: ``false``
148225

149-
##### <a name="-vcsrepo--owner"></a>`owner`
226+
##### <a name="owner"></a>`owner`
150227

151228
The user/uid that owns the repository files
152229

153-
##### <a name="-vcsrepo--p4config"></a>`p4config`
230+
##### <a name="p4config"></a>`p4config`
154231

155232
The Perforce P4CONFIG environment.
156233

157-
##### <a name="-vcsrepo--path"></a>`path`
234+
##### <a name="path"></a>`path`
158235

159236
namevar
160237

161238
Absolute path to repository
162239

163-
##### <a name="-vcsrepo--provider"></a>`provider`
240+
##### <a name="provider"></a>`provider`
164241

165242
The specific backend to use for this `vcsrepo` resource. You will seldom need to specify this --- Puppet will usually
166243
discover the appropriate provider for your platform.
167244

168-
##### <a name="-vcsrepo--remote"></a>`remote`
245+
##### <a name="remote"></a>`remote`
169246

170247
The remote repository to track
171248

172249
Default value: `origin`
173250

174-
##### <a name="-vcsrepo--safe_directory"></a>`safe_directory`
251+
##### <a name="safe_directory"></a>`safe_directory`
175252

176-
Valid values: `true`, `false`
253+
Valid values: ``true``, ``false``
177254

178255
Marks the current directory specified by the path parameter as a safe directory.
179256

180-
Default value: `false`
257+
Default value: ``false``
181258

182-
##### <a name="-vcsrepo--submodules"></a>`submodules`
259+
##### <a name="submodules"></a>`submodules`
183260

184-
Valid values: `true`, `false`
261+
Valid values: ``true``, ``false``
185262

186263
Initialize and update each submodule in the repository.
187264

188-
Default value: `true`
265+
Default value: ``true``
189266

190-
##### <a name="-vcsrepo--trust_server_cert"></a>`trust_server_cert`
267+
##### <a name="trust_server_cert"></a>`trust_server_cert`
191268

192-
Valid values: `true`, `false`
269+
Valid values: ``true``, ``false``
193270

194271
Trust server certificate
195272

196-
Default value: `false`
273+
Default value: ``false``
197274

198-
##### <a name="-vcsrepo--umask"></a>`umask`
275+
##### <a name="umask"></a>`umask`
199276

200277
Sets the umask to be used for all repo operations
201278

202-
##### <a name="-vcsrepo--user"></a>`user`
279+
##### <a name="user"></a>`user`
203280

204281
The user to run for repository operations
205282

0 commit comments

Comments
 (0)