Start before stopping and longer timeouts

This commit is contained in:
David Heinemeier Hansson
2023-02-22 19:04:23 +01:00
parent b879412a6f
commit 371f98d67f
8 changed files with 45 additions and 18 deletions

View File

@@ -55,11 +55,14 @@ class Mrsk::Cli::Main < Mrsk::Cli::Base
MRSK.version = version
if container_name_available?(MRSK.config.service_with_version)
say "Stop current version, then start version #{version}...", :magenta
say "Start version #{version}, then stop the old version...", :magenta
on(MRSK.hosts) do |host|
execute *MRSK.app.stop, raise_on_non_zero_exit: false
old_version = capture_with_info(*MRSK.app.current_running_version).strip.presence
execute *MRSK.app.start
sleep 10
execute *MRSK.app.stop(version: old_version), raise_on_non_zero_exit: false
end
audit_broadcast "Rolled back app to version #{version}"