Created
February 14, 2017 17:20
-
-
Save zmajstor/4e6d2327e9a27da1898b14305a5a00ad to your computer and use it in GitHub Desktop.
Herokuised Capistrano Tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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