-
Notifications
You must be signed in to change notification settings - Fork 497
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow custom user and port for builder host #620
Conversation
9459ff6
to
79bf674
Compare
lib/kamal/cli/build.rb
Outdated
@@ -115,7 +115,7 @@ 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 | |||
on(remote_host.gsub('ssh://', ''), options) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could do:
host = SSHKit::Host.new(
hostname: remote_uri.host,
ssh_options: { user: remote_uri.user, port: remote_uri.port }
)
on(host) do
execute "true"
end
which would avoid needing to alter the options in sshkit_with_ext.rb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, I've updated PR accordingly
When ssh options are set, they overwrite username and password passed as ssh builder uri. Passing part of uri for ssh-kit is fine, as it then properly extracts username and password and forwards it as host.ssh_options (in which case it's no longer empty)
79bf674
to
2f91236
Compare
Yep, you're right. Closing |
@mlitwiniuk - I was just referring to this line when I said we don't need it anymore. I think the rest of the PR is still valid!
|
Going to re-open as I think we want this change! |
When
ssh
options are set, they overwrite custom username and password passed via ssh builder uri. Passing part of uri for sshkit is fine, as it then properly extracts username and password and forwards it ashost.ssh_options
(in which case it's no longer empty)