summaryrefslogtreecommitdiff
path: root/lib/chef/resource
diff options
context:
space:
mode:
authorGomes da Silva <renanvice@gmail.com>2015-08-12 10:42:55 +0100
committerGomes da Silva <renanvice@gmail.com>2015-08-12 10:42:55 +0100
commit87d10c0e74b850086d11d68ccb908d0aaee1ce4a (patch)
treeca0706ed969d1221ab7a5f5daa6364e864a0b5a7 /lib/chef/resource
parent2999d552880ff8fe2d056f89205114ab7c3c9979 (diff)
downloadchef-87d10c0e74b850086d11d68ccb908d0aaee1ce4a.tar.gz
Add support for override depth and adding test in overriding depth
Diffstat (limited to 'lib/chef/resource')
-rw-r--r--lib/chef/resource/deploy.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/chef/resource/deploy.rb b/lib/chef/resource/deploy.rb
index 3e5255bced..5df46fff60 100644
--- a/lib/chef/resource/deploy.rb
+++ b/lib/chef/resource/deploy.rb
@@ -27,6 +27,7 @@
# migration_command "rake db:migrate"
# environment "RAILS_ENV" => "production", "OTHER_ENV" => "foo"
# shallow_clone true
+# depth 1
# action :deploy # or :rollback
# restart_command "touch tmp/restart.txt"
# git_ssh_wrapper "wrap-ssh4git.sh"
@@ -74,6 +75,7 @@ class Chef
@remote = "origin"
@enable_submodules = false
@shallow_clone = false
+ @depth = nil
@scm_provider = Chef::Provider::Git
@svn_force_export = false
@additional_remotes = Hash[]
@@ -97,8 +99,12 @@ class Chef
@current_path ||= @deploy_to + "/current"
end
- def depth
- @shallow_clone ? "5" : nil
+ def depth(arg=@shallow_clone ? 5 : nil)
+ set_or_return(
+ :depth,
+ arg,
+ :kind_of => [ Integer ]
+ )
end
# note: deploy_to is your application "meta-root."