diff options
author | Gomes da Silva <renanvice@gmail.com> | 2015-08-12 10:42:55 +0100 |
---|---|---|
committer | Gomes da Silva <renanvice@gmail.com> | 2015-08-12 10:42:55 +0100 |
commit | 87d10c0e74b850086d11d68ccb908d0aaee1ce4a (patch) | |
tree | ca0706ed969d1221ab7a5f5daa6364e864a0b5a7 /lib/chef/resource | |
parent | 2999d552880ff8fe2d056f89205114ab7c3c9979 (diff) | |
download | chef-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.rb | 10 |
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." |