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:
Donal McBreen
2024-05-21 09:31:08 +01:00
parent 78c0a0ba4b
commit fa7e941648
3 changed files with 45 additions and 24 deletions

View File

@@ -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"]