Created
August 21, 2011 18:14
-
-
Save joakimk/1160940 to your computer and use it in GitHub Desktop.
Rake task for cleaner output when deploying with capistrano
This file contains 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
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 |
This file contains 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
$ 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