2013-07-27 80 views
0

我有這個deploy.rbCapistrano的部署行爲

after 'deploy:update_code', 'deploy:symlink_db', 'deploy:symlink_email' 
after 'deploy:setup', 'setup:create_db_configuration', 'setup:create_email_configuration' 


namespace :deploy do 
    desc "Symlinks the email.yml" 
    task :symlink_email, :roles => :app do 
    puts "##Sybolic Link the email.yml" 
    run "ln -nfs #{deploy_to}/shared/config/email.yml #{release_path}/config/email.yml" 
    end 

desc "Symlinks the database.yml" 
    task :symlink_db, :roles => :app do 
    puts "##Sybolic Link the database.yml" 
    run "ln -nfs #{deploy_to}/shared/config/database.yml #{release_path}/config/database.yml" 
    end 

但是當我部署,部署後:update_code它

2013-07-27 03:30:30 executing `deploy:assets:symlink' 

然後

2013-07-27 03:30:32 executing `deploy:assets:precompile' 

而當開始執行

executing "cd -- /home/ubuntu/deployments/saleshub/releases/20130727013023 && RAILS_ENV=production RAILS_GROUPS=assets rake assets:precompile" 

它失敗了,因爲符號鏈接還沒有創建。在編譯資產之前,如何確保我的任務能夠創建符號鏈接?

回答

1
before 'deploy:assets:precompile', 'deploy:symlink_db', 'deploy:symlink_email' 
+0

謝謝,我改 後 '部署:finalize_update', '部署:symlink_db', '部署:symlink_email' –