Posted about 8 years ago. Visible to the public. Repeats.

Capistrano: How to find out which version of your application is currently live

When deploying, Capistrano puts a REVISION file into your application's release directory. It contains the hash of the commit which was deployed.

If you want to know the currently deployed release, simply SSH to a server and view that file.

$ cat /var/www/my-project/current/REVISION cf8734ece3938fc67262ad5e0d4336f820689307

Capistrano task

When your application is deployed to multiple servers, you probably want to see a result for all of them.
Here is a Capistrano task that checks all servers with the :app role.

namespace :deploy do desc 'Show deployed revision' task :revision do on roles :app do |host| within current_path do info "#{host}: #{capture :cat, 'REVISION'}" end end end end

Output looks like this:

$ cap production deploy:revision 00:00 deploy:revision cf8734ece3938fc67262ad5e0d4336f820689307 cf8734ece3938fc67262ad5e0d4336f820689307 cf8734ece3938fc67262ad5e0d4336f820689307

Deployment log

Note that Capistrano also logs each deployment. We have a separate card on finding out user/branch/commit/timestamp for past deployments.

Does your version of Ruby on Rails still receive security updates?
Rails LTS provides security patches for old versions of Ruby on Rails (3.2 and 2.3).

Owner of this card:

Arne Hartherz
Last edit:
10 months ago
by Arne Hartherz
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Arne Hartherz to makandra dev
This website uses short-lived cookies to improve usability.
Accept or learn more