-
Notifications
You must be signed in to change notification settings - Fork 488
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1229 from matjack1/use-ssh-keys-when-executing-co…
…mmands [FIX] - Make kamal use ssh keys from config when performing commands
- Loading branch information
Showing
2 changed files
with
21 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -315,6 +315,16 @@ class CommandsAppTest < ActiveSupport::TestCase | |
assert_equal "ssh -J [email protected] -t [email protected] -p 22 'ls'", new_command.run_over_ssh("ls", host: "1.1.1.1") | ||
end | ||
|
||
test "run over ssh with keys config" do | ||
@config[:ssh] = { "keys" => [ "path_to_key.pem" ] } | ||
assert_equal "ssh -i path_to_key.pem -t [email protected] -p 22 'ls'", new_command.run_over_ssh("ls", host: "1.1.1.1") | ||
end | ||
|
||
test "run over ssh with keys config with keys_only" do | ||
@config[:ssh] = { "keys" => [ "path_to_key.pem" ], "keys_only" => true } | ||
assert_equal "ssh -i path_to_key.pem -o IdentitiesOnly=yes -t [email protected] -p 22 'ls'", new_command.run_over_ssh("ls", host: "1.1.1.1") | ||
end | ||
|
||
test "run over ssh with proxy_command" do | ||
@config[:ssh] = { "proxy_command" => "ssh -W %h:%p user@proxy-server" } | ||
assert_equal "ssh -o ProxyCommand='ssh -W %h:%p user@proxy-server' -t [email protected] -p 22 'ls'", new_command.run_over_ssh("ls", host: "1.1.1.1") | ||
|