Permalink
Browse files

cd into rails_root when running hooks

  • Loading branch information...
1 parent 15c4277 commit 52d8935b471bb42ec1bd867fa6d064d87eaf53f2 Ezra Zygmuntowicz committed Jun 29, 2009
Showing with 5 additions and 3 deletions.
  1. +1 −1 Rakefile
  2. +4 −2 lib/chef-deploy/cached_deploy.rb
View
@@ -5,7 +5,7 @@ require 'date'
require 'spec/rake/spectask'
GEM = "chef-deploy"
-GEM_VERSION = "0.2.0"
+GEM_VERSION = "0.2.1"
AUTHOR = "Ezra Zygmuntowicz"
EMAIL = "Your Email"
HOMEPAGE = "http://example.com"
@@ -58,8 +58,10 @@ def check_current_revision_and_noop_if_same(newrev)
# before_restart
def callback(what)
if File.exist?("#{latest_release}/deploy/#{what}.rb")
- Chef::Log.info "running deploy hook: #{latest_release}/deploy/#{what}.rb"
- instance_eval(IO.read("#{latest_release}/deploy/#{what}.rb"))
+ Dir.chdir(latest_release) do
+ Chef::Log.info "running deploy hook: #{latest_release}/deploy/#{what}.rb"
+ instance_eval(IO.read("#{latest_release}/deploy/#{what}.rb"))
+ end
end
end

0 comments on commit 52d8935

Please sign in to comment.