0

我有这个 deploy.rb

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

但是当我部署时,在 deploy: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"

它失败了,因为尚未创建符号链接。在编译资产之前,如何确保我的任务是创建符号链接?

4

1 回答 1

1
before 'deploy:assets:precompile', 'deploy:symlink_db', 'deploy:symlink_email'
于 2013-07-27T11:39:46.147 回答