Skip to content

Instantly share code, notes, and snippets.

@joakimk
Created August 21, 2011 18:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joakimk/1160940 to your computer and use it in GitHub Desktop.
Save joakimk/1160940 to your computer and use it in GitHub Desktop.
Rake task for cleaner output when deploying with capistrano
task :deploy do
process = open("|cap deploy 2>&1", 'r')
begin
while(output = process.readline) do
next if [ "command finished in", "executing locally:", "servers:", "executing command",
"triggering", "transaction", "updating the cached checkout",
"copying the cached version", "* executing \"" ].any? { |s| output.include?(s) }
if output =~ /`(.+?)'/
puts "\e[32m > Executing #{$1}\e[0m"
else
puts output
end
end
rescue EOFError
end
process.close
exit($?.exitstatus)
end
$ rake deploy
> Executing deploy
> Executing deploy:update
> Executing deploy:update_code
> Executing deploy:finalize_update
> Executing bundle:install
> Executing link_config
> Executing link_files
> Executing build_assets
> Executing deploy:symlink
> Executing deploy:restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment