diff options
author | John Goulah <jgoulah@gmail.com> | 2012-12-28 16:15:34 -0500 |
---|---|---|
committer | Bryan McLellan <btm@opscode.com> | 2013-11-26 07:31:19 -0800 |
commit | 376177d9d3ebb0a239ea5a43fd64b2b74f38b361 (patch) | |
tree | 80d6f3d2cfddb5778c4b337450d4d05cc22a98b5 /lib/chef/resource/scm.rb | |
parent | ce6135e76f1be4e1496a052188183e63332ea7dc (diff) | |
download | chef-376177d9d3ebb0a239ea5a43fd64b2b74f38b361.tar.gz |
add enable_checkout attribute; add ability to override 'deploy' with checkout_branch name
Diffstat (limited to 'lib/chef/resource/scm.rb')
-rw-r--r-- | lib/chef/resource/scm.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/chef/resource/scm.rb b/lib/chef/resource/scm.rb index d9a372900e..91782e4114 100644 --- a/lib/chef/resource/scm.rb +++ b/lib/chef/resource/scm.rb @@ -32,12 +32,14 @@ class Chef @destination = name @resource_name = :scm @enable_submodules = false + @enable_checkout = true @revision = "HEAD" @remote = "origin" @ssh_wrapper = nil @depth = nil @allowed_actions.push(:checkout, :export, :sync, :diff, :log) @action = [:sync] + @checkout_branch = "deploy" end def destination(arg=nil) @@ -130,6 +132,14 @@ class Chef ) end + def enable_checkout(arg=nil) + set_or_return( + :enable_checkout, + arg, + :kind_of => [TrueClass, FalseClass] + ) + end + def remote(arg=nil) set_or_return( :remote, @@ -154,6 +164,14 @@ class Chef ) end + def checkout_branch(arg=nil) + set_or_return( + :checkout_branch, + arg, + :kind_of => String + ) + end + end end end |