Browse Source

symlink db on deploy

pull/1/head
Nicolae Claudius 13 years ago
parent
commit
ef8e0d9bbd
  1. 7
      config/deploy.rb

7
config/deploy.rb

@ -19,6 +19,8 @@ role :app, domain # This may be the same as your `Web` server
role :db, domain, :primary => true # This is where Rails migrations will run role :db, domain, :primary => true # This is where Rails migrations will run
# role :db, "your slave db-server here" # role :db, "your slave db-server here"
after 'deploy:update_code', 'deploy:symlink_db'
namespace :deploy do namespace :deploy do
task :start, :roles => :app, :except => { :no_release => true } do task :start, :roles => :app, :except => { :no_release => true } do
run "touch #{current_release}/tmp/restart.txt" run "touch #{current_release}/tmp/restart.txt"
@ -32,4 +34,9 @@ namespace :deploy do
task :restart, :roles => :app, :except => { :no_release => true } do task :restart, :roles => :app, :except => { :no_release => true } do
run "touch #{current_release}/tmp/restart.txt" run "touch #{current_release}/tmp/restart.txt"
end end
desc "Symlinks the database.yml"
task :symlink_db, :roles => :app do
run "ln -nfs #{deploy_to}/shared/config/database.yml #{release_path}/config/database.yml"
end
end end

Loading…
Cancel
Save