Move sleep note out of host loop, so we only see it once
This commit is contained in:
@@ -3,7 +3,7 @@ class Mrsk::Cli::App < Mrsk::Cli::Base
|
|||||||
def boot
|
def boot
|
||||||
say "Get most recent version available as an image...", :magenta unless options[:version]
|
say "Get most recent version available as an image...", :magenta unless options[:version]
|
||||||
using_version(options[:version] || most_recent_version_available) do |version|
|
using_version(options[:version] || most_recent_version_available) do |version|
|
||||||
say "Start container with version #{version} (or reboot if already running)...", :magenta
|
say "Start container with version #{version} using a #{MRSK.config.readiness_delay}s readiness delay (or reboot if already running)...", :magenta
|
||||||
|
|
||||||
cli = self
|
cli = self
|
||||||
|
|
||||||
@@ -14,10 +14,7 @@ class Mrsk::Cli::App < Mrsk::Cli::Base
|
|||||||
begin
|
begin
|
||||||
old_version = capture_with_info(*MRSK.app.current_running_version).strip
|
old_version = capture_with_info(*MRSK.app.current_running_version).strip
|
||||||
execute *MRSK.app.run(role: role.name)
|
execute *MRSK.app.run(role: role.name)
|
||||||
|
|
||||||
cli.say "Waiting #{MRSK.config.readiness_delay}s for app to boot...", :magenta
|
|
||||||
sleep MRSK.config.readiness_delay
|
sleep MRSK.config.readiness_delay
|
||||||
|
|
||||||
execute *MRSK.app.stop(version: old_version), raise_on_non_zero_exit: false if old_version.present?
|
execute *MRSK.app.stop(version: old_version), raise_on_non_zero_exit: false if old_version.present?
|
||||||
|
|
||||||
rescue SSHKit::Command::Failed => e
|
rescue SSHKit::Command::Failed => e
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ class Mrsk::Cli::Main < Mrsk::Cli::Base
|
|||||||
MRSK.version = version
|
MRSK.version = version
|
||||||
|
|
||||||
if container_name_available?(MRSK.config.service_with_version)
|
if container_name_available?(MRSK.config.service_with_version)
|
||||||
say "Start version #{version}, then stop the old version...", :magenta
|
say "Start version #{version}, then wait #{MRSK.config.readiness_delay}s for app to boot before stopping the old version...", :magenta
|
||||||
|
|
||||||
cli = self
|
cli = self
|
||||||
|
|
||||||
@@ -64,7 +64,6 @@ class Mrsk::Cli::Main < Mrsk::Cli::Base
|
|||||||
|
|
||||||
execute *MRSK.app.start
|
execute *MRSK.app.start
|
||||||
|
|
||||||
cli.say "Waiting #{MRSK.config.readiness_delay}s for app to start...", :magenta
|
|
||||||
sleep MRSK.config.readiness_delay
|
sleep MRSK.config.readiness_delay
|
||||||
|
|
||||||
execute *MRSK.app.stop(version: old_version), raise_on_non_zero_exit: false
|
execute *MRSK.app.stop(version: old_version), raise_on_non_zero_exit: false
|
||||||
|
|||||||
Reference in New Issue
Block a user