Skip to content

Instantly share code, notes, and snippets.

@amaudy
Created September 30, 2015 06:14
Show Gist options
  • Save amaudy/2a98f19dd51f65806d86 to your computer and use it in GitHub Desktop.
Save amaudy/2a98f19dd51f65806d86 to your computer and use it in GitHub Desktop.
Get latest revision that deployed.
# put this snippet to config/deploy.rb
# then call via Capistrano Rake task
# bundle exec cap staging latest_revision
desc "View latest commit that deploy on server"
task :latest_revision, :roles => :app do
trap("INT") { puts 'Interupted'; exit 0; }
run "cat #{deploy_to}/current/REVISION" do |channel, stream, data|
puts
puts "******* REVISION ********"
puts "Server : #{channel[:host]}"
puts "Revision : #{data}"
puts "*************************"
puts
break if stream == :err
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment