Skip to content

Commit

Permalink
Merge pull request #1029 from johanmeiring/nativessh-config-file
Browse files Browse the repository at this point in the history
Support for SSH config file in NativeSsh implementation
  • Loading branch information
antonmedv committed Feb 18, 2017
2 parents b8a4207 + 677b6ea commit c08840b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -5,6 +5,7 @@

### Added
- Add a way to retrieve a defined task [#1008](https://github.com/deployphp/deployer/pull/1008)
- Add support for configFile in the NativeSsh implementation [#979](https://github.com/deployphp/deployer/pull/979)

### Changed
- Autoload functions via Composer [#1015](https://github.com/deployphp/deployer/pull/1015)
Expand Down
11 changes: 11 additions & 0 deletions src/Server/Remote/NativeSsh.php
Expand Up @@ -65,6 +65,10 @@ public function run($command)
}
$hostname = $serverConfig->getHost();

if ($serverConfig->getConfigFile()) {
$sshOptions[] = '-F ' . escapeshellarg($serverConfig->getConfigFile());
}

if ($serverConfig->getPort()) {
$sshOptions[] = '-p ' . escapeshellarg($serverConfig->getPort());
}
Expand Down Expand Up @@ -134,6 +138,10 @@ public function scpCopy($target, $target2)

$scpOptions = [];

if ($serverConfig->getConfigFile()) {
$scpOptions[] = '-F ' . escapeshellarg($serverConfig->getConfigFile());
}

if ($serverConfig->getPort()) {
$scpOptions[] = '-P ' . escapeshellarg($serverConfig->getPort());
}
Expand Down Expand Up @@ -241,6 +249,9 @@ public function initMultiplexing()
$hostname = $serverConfig->getHost();

$sshOptions = [];
if ($serverConfig->getConfigFile()) {
$sshOptions[] = '-F ' . escapeshellarg($serverConfig->getConfigFile());
}
if ($serverConfig->getPort()) {
$sshOptions[] = '-p ' . escapeshellarg($serverConfig->getPort());
}
Expand Down

0 comments on commit c08840b

Please sign in to comment.