Fix more configs. Refs #2261

This commit is contained in:
Pavel Chipiga 2011-12-06 21:33:35 +02:00
parent 7e05c5b385
commit 3ab92c0281
2 changed files with 12 additions and 11 deletions

View File

@ -42,16 +42,17 @@ namespace :deploy do
end
task :symlink_all, :roles => :web do
# run "mkdir -p #{fetch :shared_path}/config"
# Never do this!!!
# run "yes y | cp -i #{fetch :release_path}/config/database.yml.sample #{fetch :shared_path}/config/database.yml"
# run "yes y | cp -i #{fetch :release_path}/config/application.yml.sample #{fetch :shared_path}/config/application.yml"
run "mkdir -p #{fetch :shared_path}/config"
run "cp -n #{fetch :release_path}/config/database.yml.sample #{fetch :shared_path}/config/database.yml"
run "cp -n #{fetch :release_path}/config/application.yml.sample #{fetch :shared_path}/config/application.yml"
run "ln -nfs #{fetch :shared_path}/config/database.yml #{fetch :release_path}/config/database.yml"
run "ln -nfs #{fetch :shared_path}/config/application.yml #{fetch :release_path}/config/application.yml"
run "mkdir -p #{fetch :shared_path}/downloads"
run "ln -nfs #{fetch :shared_path}/downloads/ #{fetch :release_path}/public/downloads"
run "mkdir -p #{fetch :shared_path}/tmp"
run "ln -nfs #{fetch :shared_path}/pids/ #{fetch :shared_path}/tmp/pids"
run "ln -nfs #{fetch :shared_path}/tmp/ #{fetch :release_path}/tmp"
run "mkdir -p #{fetch :release_path}/tmp/mount"
run "mkdir -p #{fetch :release_path}/tmp/umount"

View File

@ -9,18 +9,18 @@ Capistrano::Configuration.instance(:must_exist).load do
run "cd #{fetch :current_path} && #{try_sudo} #{unicorn_binary} -c #{unicorn_config} -p #{unicorn_port} -E #{rails_env} -D"
end
task :stop, :roles => :app, :except => { :no_release => true } do
run "#{try_sudo} kill `cat #{unicorn_pid}`"
run "#{try_sudo} kill `cat #{unicorn_pid}`" rescue warn 'deploy:stop FAILED'
end
task :graceful_stop, :roles => :app, :except => { :no_release => true } do
run "#{try_sudo} kill -s QUIT `cat #{unicorn_pid}`"
run "#{try_sudo} kill -s QUIT `cat #{unicorn_pid}`" rescue warn 'deploy:graceful_stop FAILED'
end
task :reload, :roles => :app, :except => { :no_release => true } do
run "#{try_sudo} kill -s USR2 `cat #{unicorn_pid}`"
run "#{try_sudo} kill -s USR2 `cat #{unicorn_pid}`" rescue warn 'deploy:reload FAILED'
end
task :restart, :roles => :app, :except => { :no_release => true } do
reload
# stop
# start
# reload
stop
start
end
end
end