How do you roll back to the previously deployed version with capistrano?

后端 未结 4 1657
清歌不尽
清歌不尽 2021-01-30 00:52

I tried using "cap rollback" but I get the following error:

$ cap rollback

the task `rollback\' does not exist

Is there

4条回答
  •  北恋
    北恋 (楼主)
    2021-01-30 01:08

    If you're using different environments (e.g. staging, production) using the multistage gem (e.g. you have require 'capistrano/ext/multistage' in your deploy.rb file) then Capistrano defaults to staging. So, to roll back a production environment you would do:

    cap production deploy:rollback
    

    and, assuming you've got the defaults set, this would roll back staging:

    cap deploy:rollback
    

    Worth knowing if you're using different environments and wondering why it's not working for production.

提交回复
热议问题