Deploy:symlink on capistrano points the “current” directory to previous release

北城以北 提交于 2019-12-03 16:59:54
foresth

I solved this with an additional deploy task that recreates the symlink using a different internal variable name with the correct path to the latest release (release_path instead of latest_path or something like that).


namespace :deploy do
  desc "Recreate symlink"
  task :resymlink, :roles => :app do
    run "rm -f #{current_path} && ln -s #{release_path} #{current_path}"
  end
end

after "deploy:create_symlink", "deploy:resymlink", "deploy:update_crontab"

I think @foresth's answer is not a good solution.

I think what happens is that you're experiencing this horrible bug of capistrano.

The way to work-around the bug is the following: DO NOT READ THE latest_release VARIABLE BEFORE THE TASK deploy HAPPENS.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!