Simplified deploy options for kamal-proxy as it supports multiple --host arguments

This commit is contained in:
Dmytro Shteflyuk
2024-09-30 08:09:05 -04:00
parent 67ad7662ab
commit e75365c8c6
2 changed files with 2 additions and 2 deletions

View File

@@ -28,7 +28,7 @@ class Kamal::Configuration::Proxy
def deploy_options def deploy_options
{ {
host: hosts.present? ? hosts.join(",") : nil, host: hosts,
tls: proxy_config["ssl"] ? true : nil, tls: proxy_config["ssl"] ? true : nil,
"deploy-timeout": seconds_duration(config.deploy_timeout), "deploy-timeout": seconds_duration(config.deploy_timeout),
"drain-timeout": seconds_duration(config.drain_timeout), "drain-timeout": seconds_duration(config.drain_timeout),

View File

@@ -131,7 +131,7 @@ class CommandsAppTest < ActiveSupport::TestCase
@config[:proxy] = { "ssl" => true, "hosts" => [ "example.com", "anotherexample.com" ] } @config[:proxy] = { "ssl" => true, "hosts" => [ "example.com", "anotherexample.com" ] }
assert_equal \ assert_equal \
"docker exec kamal-proxy kamal-proxy deploy app-web --target \"172.1.0.2:80\" --host \"example.com,anotherexample.com\" --tls --deploy-timeout \"30s\" --drain-timeout \"30s\" --buffer-requests --buffer-responses --log-request-header \"Cache-Control\" --log-request-header \"Last-Modified\" --log-request-header \"User-Agent\"", "docker exec kamal-proxy kamal-proxy deploy app-web --target \"172.1.0.2:80\" --host \"example.com\" --host \"anotherexample.com\" --tls --deploy-timeout \"30s\" --drain-timeout \"30s\" --buffer-requests --buffer-responses --log-request-header \"Cache-Control\" --log-request-header \"Last-Modified\" --log-request-header \"User-Agent\"",
new_command.deploy(target: "172.1.0.2").join(" ") new_command.deploy(target: "172.1.0.2").join(" ")
end end