mirror of
https://github.com/andres-montanez/Magallanes
synced 2024-05-24 09:22:14 +02:00
Issue #289 Support for ssh proxy
This commit is contained in:
parent
47e4d7c9a1
commit
51156c13f9
|
@ -388,6 +388,15 @@ class Config
|
|||
return $this->deployment('identity-file') ? ('-i ' . $this->deployment('identity-file') . ' ') : '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get additional ssh proxy
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSshProxy()
|
||||
{
|
||||
return $this->deployment('ssh-proxy') ? $this->deployment('ssh-proxy') : '';
|
||||
}
|
||||
/**
|
||||
* Get the ConnectTimeout option
|
||||
*
|
||||
|
|
|
@ -208,7 +208,7 @@ class Console
|
|||
|
||||
$return = 1;
|
||||
$log = array();
|
||||
exec(escapeshellcmd($command . ' 2>&1'), $log, $return);
|
||||
exec($command . ' 2>&1', $log, $return);
|
||||
$log = implode(PHP_EOL, $log);
|
||||
|
||||
if (!$return) {
|
||||
|
|
|
@ -198,6 +198,7 @@ abstract class AbstractTask
|
|||
|
||||
$localCommand = 'ssh ' . $this->getConfig()->getHostIdentityFileOption() . $needs_tty . ' -p ' . $this->getConfig()->getHostPort() . ' '
|
||||
. '-q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no '
|
||||
. ($this->getConfig()->getSshProxy() ? sprintf('-o ProxyCommand="ssh -W %%h:%%p %s" ', $this->getConfig()->getSshProxy()) : '')
|
||||
. $this->getConfig()->getConnectTimeoutOption()
|
||||
. ($this->getConfig()->deployment('user') != '' ? $this->getConfig()->deployment('user') . '@' : '')
|
||||
. $this->getConfig()->getHostName();
|
||||
|
|
|
@ -97,6 +97,7 @@ class RsyncTask extends BaseStrategyTaskAbstract implements IsReleaseAware
|
|||
$command = 'rsync -avz '
|
||||
. $strategyFlags . ' '
|
||||
. '--rsh="ssh ' . $this->getConfig()->getHostIdentityFileOption() . '-p' . $this->getConfig()->getHostPort() . '" '
|
||||
. ($this->getConfig()->getSshProxy() ? sprintf('-e \'ssh -A %s ssh\' ', $this->getConfig()->getSshProxy()) : '')
|
||||
. $this->excludes($excludes) . ' '
|
||||
. $this->excludesListFile($excludesListFilePath) . ' '
|
||||
. $this->getConfig()->deployment('from') . ' '
|
||||
|
|
|
@ -96,6 +96,7 @@ class TarGzTask extends BaseStrategyTaskAbstract implements IsReleaseAware
|
|||
$command = 'scp ' . $strategyFlags . ' ' . $this->getConfig()->getHostIdentityFileOption()
|
||||
. $this->getConfig()->getConnectTimeoutOption() . '-P ' . $this->getConfig()->getHostPort()
|
||||
. " -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no "
|
||||
. ($this->getConfig()->getSshProxy() ? sprintf('-o ProxyCommand="ssh -W %%h:%%p %s" ', $this->getConfig()->getSshProxy()) : '')
|
||||
. ' ' . $localTarGz . '.tar.gz '
|
||||
. $this->getConfig()->deployment('user') . '@' . $this->getConfig()->getHostName() . ':'
|
||||
. $deployToDirectory;
|
||||
|
|
Loading…
Reference in a new issue