summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBryan Jen <bryan.jen@gmail.com>2015-09-14 09:47:27 -0700
committerBryan Jen <bryan.jen@gmail.com>2015-09-14 09:47:27 -0700
commitf0d087a1cbf99228b9edb3e1d2e28d81df794e24 (patch)
treed71e709dcf31f43f56d9220f349fc976705e437d /lib
parenta39349a4388cd56aad5cfc8eead2f2a17f545287 (diff)
parent7758331f503a9198921362761079cbfd941c625e (diff)
downloadpuppet-vcsrepo-f0d087a1cbf99228b9edb3e1d2e28d81df794e24.tar.gz
puppet-vcsrepo-f0d087a1cbf99228b9edb3e1d2e28d81df794e24.tar.bz2
Merge pull request #269 from monai/develop
Add feature 'depth' and parameter 'trust_server_cert' to svn
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/provider/vcsrepo/svn.rb14
-rw-r--r--lib/puppet/type/vcsrepo.rb8
2 files changed, 18 insertions, 4 deletions
diff --git a/lib/puppet/provider/vcsrepo/svn.rb b/lib/puppet/provider/vcsrepo/svn.rb
index 905d5ad..ba77464 100644
--- a/lib/puppet/provider/vcsrepo/svn.rb
+++ b/lib/puppet/provider/vcsrepo/svn.rb
@@ -7,7 +7,7 @@ Puppet::Type.type(:vcsrepo).provide(:svn, :parent => Puppet::Provider::Vcsrepo)
:svnadmin => 'svnadmin',
:svnlook => 'svnlook'
- has_features :filesystem_types, :reference_tracking, :basic_auth, :configuration, :conflict
+ has_features :filesystem_types, :reference_tracking, :basic_auth, :configuration, :conflict, :depth
def create
if !@resource.value(:source)
@@ -15,7 +15,8 @@ Puppet::Type.type(:vcsrepo).provide(:svn, :parent => Puppet::Provider::Vcsrepo)
else
checkout_repository(@resource.value(:source),
@resource.value(:path),
- @resource.value(:revision))
+ @resource.value(:revision),
+ @resource.value(:depth))
end
update_owner
end
@@ -62,6 +63,10 @@ Puppet::Type.type(:vcsrepo).provide(:svn, :parent => Puppet::Provider::Vcsrepo)
args.push('--config-dir', @resource.value(:configuration))
end
+ if @resource.value(:trust_server_cert)
+ args.push('--trust-server-cert')
+ end
+
args
end
@@ -105,11 +110,14 @@ Puppet::Type.type(:vcsrepo).provide(:svn, :parent => Puppet::Provider::Vcsrepo)
private
- def checkout_repository(source, path, revision)
+ def checkout_repository(source, path, revision, depth)
args = buildargs.push('checkout')
if revision
args.push('-r', revision)
end
+ if depth
+ args.push('--depth', depth)
+ end
args.push(source, path)
svn(*args)
end
diff --git a/lib/puppet/type/vcsrepo.rb b/lib/puppet/type/vcsrepo.rb
index e5dfbb5..dfc2ec8 100644
--- a/lib/puppet/type/vcsrepo.rb
+++ b/lib/puppet/type/vcsrepo.rb
@@ -38,7 +38,7 @@ Puppet::Type.newtype(:vcsrepo) do
"The provider understands the CVS_RSH environment variable"
feature :depth,
- "The provider can do shallow clones"
+ "The provider can do shallow clones or set scope limit"
feature :branch,
"The name of the branch"
@@ -227,6 +227,12 @@ Puppet::Type.newtype(:vcsrepo) do
newparam :conflict do
desc "The action to take if conflicts exist between repository and working copy"
end
+
+ newparam :trust_server_cert do
+ desc "Trust server certificate"
+ newvalues(:true, :false)
+ defaultto false
+ end
autorequire(:package) do
['git', 'git-core']