mirror of
https://github.com/andres-montanez/Magallanes
synced 2024-06-16 20:45:02 +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') . ' ') : '';
|
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
|
* Get the ConnectTimeout option
|
||||||
*
|
*
|
||||||
|
|
|
@ -208,7 +208,7 @@ class Console
|
||||||
|
|
||||||
$return = 1;
|
$return = 1;
|
||||||
$log = array();
|
$log = array();
|
||||||
exec(escapeshellcmd($command . ' 2>&1'), $log, $return);
|
exec($command . ' 2>&1', $log, $return);
|
||||||
$log = implode(PHP_EOL, $log);
|
$log = implode(PHP_EOL, $log);
|
||||||
|
|
||||||
if (!$return) {
|
if (!$return) {
|
||||||
|
|
|
@ -198,6 +198,7 @@ abstract class AbstractTask
|
||||||
|
|
||||||
$localCommand = 'ssh ' . $this->getConfig()->getHostIdentityFileOption() . $needs_tty . ' -p ' . $this->getConfig()->getHostPort() . ' '
|
$localCommand = 'ssh ' . $this->getConfig()->getHostIdentityFileOption() . $needs_tty . ' -p ' . $this->getConfig()->getHostPort() . ' '
|
||||||
. '-q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no '
|
. '-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()->getConnectTimeoutOption()
|
||||||
. ($this->getConfig()->deployment('user') != '' ? $this->getConfig()->deployment('user') . '@' : '')
|
. ($this->getConfig()->deployment('user') != '' ? $this->getConfig()->deployment('user') . '@' : '')
|
||||||
. $this->getConfig()->getHostName();
|
. $this->getConfig()->getHostName();
|
||||||
|
|
|
@ -97,6 +97,7 @@ class RsyncTask extends BaseStrategyTaskAbstract implements IsReleaseAware
|
||||||
$command = 'rsync -avz '
|
$command = 'rsync -avz '
|
||||||
. $strategyFlags . ' '
|
. $strategyFlags . ' '
|
||||||
. '--rsh="ssh ' . $this->getConfig()->getHostIdentityFileOption() . '-p' . $this->getConfig()->getHostPort() . '" '
|
. '--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->excludes($excludes) . ' '
|
||||||
. $this->excludesListFile($excludesListFilePath) . ' '
|
. $this->excludesListFile($excludesListFilePath) . ' '
|
||||||
. $this->getConfig()->deployment('from') . ' '
|
. $this->getConfig()->deployment('from') . ' '
|
||||||
|
|
|
@ -96,6 +96,7 @@ class TarGzTask extends BaseStrategyTaskAbstract implements IsReleaseAware
|
||||||
$command = 'scp ' . $strategyFlags . ' ' . $this->getConfig()->getHostIdentityFileOption()
|
$command = 'scp ' . $strategyFlags . ' ' . $this->getConfig()->getHostIdentityFileOption()
|
||||||
. $this->getConfig()->getConnectTimeoutOption() . '-P ' . $this->getConfig()->getHostPort()
|
. $this->getConfig()->getConnectTimeoutOption() . '-P ' . $this->getConfig()->getHostPort()
|
||||||
. " -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no "
|
. " -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no "
|
||||||
|
. ($this->getConfig()->getSshProxy() ? sprintf('-o ProxyCommand="ssh -W %%h:%%p %s" ', $this->getConfig()->getSshProxy()) : '')
|
||||||
. ' ' . $localTarGz . '.tar.gz '
|
. ' ' . $localTarGz . '.tar.gz '
|
||||||
. $this->getConfig()->deployment('user') . '@' . $this->getConfig()->getHostName() . ':'
|
. $this->getConfig()->deployment('user') . '@' . $this->getConfig()->getHostName() . ':'
|
||||||
. $deployToDirectory;
|
. $deployToDirectory;
|
||||||
|
|
Loading…
Reference in a new issue