Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

With Capistrano, how to rollback to a specific release?

Tags:

capistrano

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
like image 451
Blankman Avatar asked Dec 05 '10 16:12

Blankman


2 Answers

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
like image 159
severin Avatar answered Feb 04 '23 08:02

severin


Another option is

$ cap deploy:rollback ROLLBACK_RELEASE=20160614133327

from http://capistranorb.com/documentation/getting-started/rollbacks/#

like image 37
not_underground Avatar answered Feb 04 '23 09:02

not_underground