Skip to content

Commit

Permalink
make sure to link in log dir before trying to migrate
Browse files Browse the repository at this point in the history
  • Loading branch information
Ezra Zygmuntowicz committed Sep 16, 2009
1 parent 219e507 commit 3d9a998
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/chef-deploy/cached_deploy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def deploy
def restart
unless @configuration[:restart_command].empty?
Chef::Log.info "restarting app: #{latest_release}"
chef_run("cd #{current_path} && sudo -u #{user} RAILS_ENV=#{@configuration[:environment]} RACK_ENV=#{@configuration[:environment]} MERB_ENV=#{@configuration[:environment]} #{@configuration[:restart_command]}")
chef_run("cd #{current_path} && sudo -u #{user} INLINEDIR=/tmp RAILS_ENV=#{@configuration[:environment]} RACK_ENV=#{@configuration[:environment]} MERB_ENV=#{@configuration[:environment]} #{@configuration[:restart_command]}")
end
end

Expand Down Expand Up @@ -92,6 +92,7 @@ def rollback
def migrate
if @configuration[:migrate]
chef_run "ln -nfs #{shared_path}/config/database.yml #{latest_release}/config/database.yml"
chef_run "ln -nfs #{shared_path}/log #{latest_release}/log"
Chef::Log.info "Migrating: cd #{latest_release} && sudo -u #{user} RAILS_ENV=#{@configuration[:environment]} RACK_ENV=#{@configuration[:environment]} MERB_ENV=#{@configuration[:environment]} #{@configuration[:migration_command]}"
chef_run("chown -R #{user}:#{group} #{latest_release}")
chef_run("cd #{latest_release} && sudo -u #{user} RAILS_ENV=#{@configuration[:environment]} RACK_ENV=#{@configuration[:environment]} MERB_ENV=#{@configuration[:environment]} #{@configuration[:migration_command]}")
Expand Down

0 comments on commit 3d9a998

Please sign in to comment.