MechDog
MechDog

Reputation: 548

Rails see what commit a capistrano deploy is

Is there a variable or method somewhere to see what commit a site is running? I have multiple environments and I want to be able to see one is on commit say "121asd" while another is on "313sad" for troubleshooting purposes.

Upvotes: 0

Views: 141

Answers (2)

Kindoloki
Kindoloki

Reputation: 614

You can see deployed commit into the APP_FOLDER/revisions.log

This file is updated on deploy:finished step code More info about this file is here

Upvotes: 0

davids
davids

Reputation: 6371

The current commit's hash is stored in /app_deploy_folder/current/REVISION, so just doing a cat of that file should do. If you want to see it in your local machine, you can define a capistrano task like the following:

desc "Show current commit's hash"
task :show_commit do
  on roles(:all) do
    within release_path do
      execute "cat #{release_path}/REVISION"
    end
  end
end

Upvotes: 1

Related Questions