Ruby 3.2.0 compatibility

This commit is contained in:
David Heinemeier Hansson
2023-01-10 13:17:18 +01:00
parent ff5ccac8fe
commit 6b098a1e2e
3 changed files with 20 additions and 1 deletions

View File

@@ -41,7 +41,7 @@ GEM
net-scp (4.0.0) net-scp (4.0.0)
net-ssh (>= 2.6.5, < 8.0.0) net-ssh (>= 2.6.5, < 8.0.0)
net-ssh (7.0.1) net-ssh (7.0.1)
nokogiri (1.13.10-arm64-darwin) nokogiri (1.14.0.rc1-arm64-darwin)
racc (~> 1.4) racc (~> 1.4)
racc (1.6.2) racc (1.6.2)
rack (2.2.5) rack (2.2.5)

View File

@@ -33,6 +33,24 @@ namespace :mrsk do
end end
end end
desc "Run app on servers (or start them if they've already been run)"
task :run do
MRSK_CONFIG.roles.each do |role|
on(MRSK_CONFIG.servers(role: role)) do |host|
begin
execute *app.run(role: role)
rescue SSHKit::Command::Failed => e
if e.message =~ /already in use/
puts "Container with same version already deployed on #{host}, starting that instead"
execute *app.start, host: host
else
raise
end
end
end
end
end
desc "Start existing app on servers" desc "Start existing app on servers"
task :start do task :start do
on(MRSK_CONFIG.servers) { execute *app.start, raise_on_non_zero_exit: false } on(MRSK_CONFIG.servers) { execute *app.start, raise_on_non_zero_exit: false }

View File

@@ -1,6 +1,7 @@
require "bundler/setup" require "bundler/setup"
require "active_support/test_case" require "active_support/test_case"
require "active_support/testing/autorun" require "active_support/testing/autorun"
require "debug"
ActiveSupport::LogSubscriber.logger = ActiveSupport::Logger.new(STDOUT) if ENV["VERBOSE"] ActiveSupport::LogSubscriber.logger = ActiveSupport::Logger.new(STDOUT) if ENV["VERBOSE"]