Skip to content

Instantly share code, notes, and snippets.

@zmajstor zmajstor/info.rake
Created Feb 14, 2017

Embed
What would you like to do?
Herokuised Capistrano Tasks
namespace :info do
desc 'Show deployed revisions (releases)'
task :releases do
on roles(:app) do
within deploy_path do
with rails_env: "#{fetch(:stage)}" do
deployed_releases = capture(:tac, revision_log)
puts "=== #{fetch(:application)} releases:"
puts deployed_releases
end
end
end
end
desc 'Show current ruby version in the current_path'
namespace :ruby do
on roles(:app) do
within current_path do
with rails_env: "#{fetch(:stage)}" do
output = capture(:ruby, '--version')
puts "Current Ruby version in #{current_path}"
puts output
end
end
end
end
desc 'Show Config Vars (ENV)'
task :env do
on roles(:all) do
within current_path do
with rails_env: "#{fetch(:stage)}" do
remote_env = capture(:env)
puts "=== #{fetch(:application)} Config Vars"
puts remote_env
end
end
end
end
desc 'Show latest deployed revision (release)'
task :rev do
on roles(:app) do
within current_path do
with rails_env: "#{fetch(:stage)}" do
revision = capture(:cat, "#{current_path}/REVISION")
puts "=== #{fetch(:application)}'s latest deployed revision (release) is #{revision}"
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.