Make SSHKit::Runner::Parallel fail slow
Using a different SSHKit runner doesn't work well, because the group runner uses the Parallel runner internally. So instead we'll patch its behaviour to fail slow. We'll also get it to return all the errors so we can report on all the hosts that failed.
This commit is contained in:
@@ -7,6 +7,15 @@ require "kamal"
|
||||
|
||||
begin
|
||||
Kamal::Cli::Main.start(ARGV)
|
||||
rescue SSHKit::Runner::MultipleExecuteError => e
|
||||
e.execute_errors.each do |execute_error|
|
||||
puts " \e[31mERROR (#{execute_error.cause.class}): #{execute_error.message}\e[0m"
|
||||
end
|
||||
if ENV["VERBOSE"]
|
||||
puts "Backtrace for the first error:"
|
||||
puts e.execute_errors.first.cause.backtrace
|
||||
end
|
||||
exit 1
|
||||
rescue SSHKit::Runner::ExecuteError => e
|
||||
puts " \e[31mERROR (#{e.cause.class}): #{e.message}\e[0m"
|
||||
puts e.cause.backtrace if ENV["VERBOSE"]
|
||||
|
||||
Reference in New Issue
Block a user