With Capistrano, how to rollback to a specific release?
My server's folder has a /release folder, how can I rollback to a specific one?
Is it possible for me to get a list of releases on my computer locally?
I'm using GIT and this didn't work:
cap deploy -s revision:HASH
Update The answer was written in the times of capistrano version 2. With the current capistrano version 3 you can achieve the same by using
cap production deploy:rollback ROLLBACK_RELEASE=2010123
Please refer to the Capistrano documentation for further details.
Thanks to @codenoob for pointing this out!
Old version
The following should work:
cap deploy:rollback -s previous_release=/path/to/release/on/server
Example:
Lets say you have deployed your app to /srv/some_app
and you have the following releases/directory structure:
|- srv
|- some_app
|- shared
|- current -> /srv/some_app/releases/2012123
|- releases
|- 2010123
|- 2011123
|- 2012123
If you now want to go back from the current (2012123) release to the 2010123 one, you would use
cap deploy:rollback -s previous_release=/srv/some_app/releases/2010123
Another option is
$ cap deploy:rollback ROLLBACK_RELEASE=20160614133327
from http://capistranorb.com/documentation/getting-started/rollbacks/#
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With