Revisions
-
lamdor revised this gist
Mar 27, 2012 . 1 changed file with 13 additions and 22 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,39 +1,30 @@ require 'chef/resource/deploy' require 'chef/provider/deploy/revision' class Chef class Resource class Deploy def before_rollback(arg=nil, &block) arg ||= block set_or_return(:before_rollback, arg, :kind_of => [Proc, String]) end end end end class Chef class Provider class Deploy class Revision def action_rollback callback(:before_rollback, @new_resource.before_rollback) super end end end end end -
darrinholst created this gist
Mar 27, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,39 @@ class Chef class Resource class Deploy < Chef::Resource def on_start(arg=nil, &block) arg ||= block set_or_return(:on_start, arg, :kind_of => [Proc, String]) end def on_complete(arg=nil, &block) arg ||= block set_or_return(:on_complete, arg, :kind_of => [Proc, String]) end def on_error(arg=nil, &block) arg ||= block set_or_return(:on_error, arg, :kind_of => [Proc, String]) end end end end class Chef class Provider class Deploy < Chef::Provider alias :old_deploy :deploy def deploy begin callback(:on_start, @new_resource.on_start) old_deploy callback(:on_complete, @new_resource.on_complete) rescue => e callback(:on_error, @new_resource.on_error) raise e end end end end end