Skip to content

Instantly share code, notes, and snippets.

@silasb
silasb / deploy.rb
Last active December 14, 2015 14:39 — forked from mlangenberg/deploy.rb
namespace :log do
desc "Downloads application logs to ./log/deploy/<RAILS_ENV>/<TIMESTAMP>/"
task :fetch, :roles => :app do
source = "#{shared_path}/log/#{rails_env}.log"
files_per_host = {}
run "ls #{source}" do |channel, stream, data|
files_per_host[channel[:xserver]] = data.split("\n").map(&:split)
end
destination = File.join('log', 'deploy')