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

后端 未结 4 1656
清歌不尽
清歌不尽 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.

    0 讨论(0)
  • 2021-01-30 01:16

    Just found the answer here http://github.com/leehambley/railsless-deploy:

    cap deploy:rollback

    0 讨论(0)
  • 2021-01-30 01:32

    simple roll back:

    $ cap deploy:rollback
    

    rollback to specific version:

    $ cap deploy:rollback -s previous_release= [path to previous release under releases folder ]
    
    0 讨论(0)
  • 2021-01-30 01:32

    Actually it is

    cap deploy:rollback:code
    

    deploy:rollback may rollback to a previous revision, not necessarily a previously deployed revision.

    0 讨论(0)
提交回复
热议问题