Using Capistrano, how can I see a list of releases and then rollback to one of them?
Using Capistrano, how can I see 开发者_运维知识库a list of releases and then rollback to one of them?
This is a rails app, running on phusion with nginx.
To see what versions have been previously released - I use the Capistrano shell
$ cap shell
# Show the release directory - it might be a long list
cap> ls /mnt/html/deployed/releases/
** [out :: hostname.example.com] 20110521130031
# which revisions are current now
cap> cat /mnt/html/deployed/current/REVISION
** [out :: hostname.example.com] 5201
There's no way to roll back to a specific version (that isn't the previous one). You can release that older one though.
If you want to push a tag, you have to change the :repository URL (since Subversion doesn't really support tags--you actually push from a different path in the repository instead). If you want to push a specific revision number from the current repository, you just set the :revision variable. You can set either of these from the command-line: from: http://groups.google.com/group/capistrano/msg/10cc8ac9997d5e2a
cap -s repository=http://blah.blah.blah deploy
cap -s revision=123 deploy
cap deploy:rollback -s previous_release=/path/to/release/on/server
From https://stackoverflow.com/a/11139185/620780 or look at capistrano source at github
精彩评论