部署时出现以下错误
DEBUG[c3b88189] Running /usr/bin/env [ -f /home/ubuntu/apps/stag/shared/config/database.yml ] on **.***.***.**
DEBUG[c3b88189] Command: [ -f /home/ubuntu/apps/
stag/shared/config/database.yml ]
DEBUG[c3b88189] Finished in 0.579 seconds with exit status 1 (failed).
ERROR linked file /home/ubuntu/apps/stag/shared/config/database.yml does not exist on **.***.***.**
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing on host **.***.***.**: exit
SystemExit: exit
Tasks: TOP => deploy:check:linked_files
(See full trace by running task with --trace)
The deploy has failed with an error: Exception while executing on host
如何纠正这个问题?
答案 0 :(得分:0)
remote_file任务允许将远程文件的存在设置为先决条件。如果需要,这些任务又可以依赖于本地文件。
namespace :deploy do
namespace :check do
task :linked_files => 'config/database.yml'
end
end
remote_file 'config/database.yml' => '/local/database.yml'
http://capistranorb.com/documentation/advanced-features/remote-file/