Sha256: bec04ca2c86e20329b0509b0ba3f73508abd3755a0a73660aa5cae9b0c127912

Contents?: true

Size: 735 Bytes

Versions: 2

Compression:

Stored size: 735 Bytes

Contents

class Kamal::Cli::Healthcheck < Kamal::Cli::Base
  default_command :perform

  desc "perform", "Health check current app version"
  def perform
    on(KAMAL.primary_host) do
      begin
        execute *KAMAL.healthcheck.run
        Kamal::Utils::HealthcheckPoller.wait_for_healthy { capture_with_info(*KAMAL.healthcheck.status) }
      rescue Kamal::Utils::HealthcheckPoller::HealthcheckError => e
        error capture_with_info(*KAMAL.healthcheck.logs)
        error capture_with_pretty_json(*KAMAL.healthcheck.container_health_log)
        raise
      ensure
        execute *KAMAL.healthcheck.stop, raise_on_non_zero_exit: false
        execute *KAMAL.healthcheck.remove, raise_on_non_zero_exit: false
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
kamal-0.16.1 lib/kamal/cli/healthcheck.rb
kamal-0.16.0 lib/kamal/cli/healthcheck.rb