Merge pull request #620 from mlitwiniuk/allow_custom_ports_for_ssh

Allow custom user and port for builder host
This commit is contained in:
Donal McBreen
2024-05-21 11:49:06 +01:00
committed by GitHub
3 changed files with 58 additions and 2 deletions

View File

@@ -127,8 +127,11 @@ class Kamal::Cli::Build < Kamal::Cli::Base
def connect_to_remote_host(remote_host)
remote_uri = URI.parse(remote_host)
if remote_uri.scheme == "ssh"
options = { user: remote_uri.user, port: remote_uri.port }.compact
on(remote_uri.host, options) do
host = SSHKit::Host.new(
hostname: remote_uri.host,
ssh_options: { user: remote_uri.user, port: remote_uri.port }.compact
)
on(host, options) do
execute "true"
end
end