diff --git a/lib/kamal/commands/healthcheck.rb b/lib/kamal/commands/healthcheck.rb index 5adc02445..f7bc867d2 100644 --- a/lib/kamal/commands/healthcheck.rb +++ b/lib/kamal/commands/healthcheck.rb @@ -1,7 +1,7 @@ class Kamal::Commands::Healthcheck < Kamal::Commands::Base def run - web = config.role(:web) + web = config.role(:web) || config.roles.select(&:running_traefik?).first docker :run, "--detach", diff --git a/lib/kamal/configuration.rb b/lib/kamal/configuration.rb index fc881c069..2ba442601 100644 --- a/lib/kamal/configuration.rb +++ b/lib/kamal/configuration.rb @@ -25,7 +25,7 @@ def load_config_files(*files) def load_config_file(file) if file.exist? - YAML.load(ERB.new(IO.read(file)).result).symbolize_keys + YAML.load(ERB.new(IO.read(file)).result, aliases: true).symbolize_keys else raise "Configuration file not found in #{file}" end @@ -90,7 +90,7 @@ def all_hosts end def primary_web_host - role(:web).primary_host + (role(:web) || roles.select(&:running_traefik?).first).primary_host end def traefik_hosts @@ -249,7 +249,7 @@ def ensure_required_keys_present roles.each do |role| if role.hosts.empty? - raise ArgumentError, "No servers specified for the #{role.name} role" + puts "Warning: No servers specified for the #{role.name} role" end end