mirror of
https://github.com/hauke68/Magallanes.git
synced 2026-09-09 14:58:57 +02:00
[BUGFIX] [Issue#405] Malformed ssh command when defining host:port notation
This commit is contained in:
@@ -175,8 +175,8 @@ class DeployCommand extends AbstractCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($this->runtime->getWorkingHost() !== null) {
|
||||
$output->writeln(sprintf(' Starting <fg=black;options=bold>%s</> tasks on host <fg=black;options=bold>%s</>:', $this->getStageName(), $this->runtime->getWorkingHost()));
|
||||
if ($this->runtime->getHostName() !== null) {
|
||||
$output->writeln(sprintf(' Starting <fg=black;options=bold>%s</> tasks on host <fg=black;options=bold>%s</>:', $this->getStageName(), $this->runtime->getHostName()));
|
||||
} else {
|
||||
$output->writeln(sprintf(' Starting <fg=black;options=bold>%s</> tasks:', $this->getStageName()));
|
||||
}
|
||||
|
||||
+12
-1
@@ -429,7 +429,7 @@ class Runtime
|
||||
{
|
||||
$user = $this->getEnvOption('user', $this->getCurrentUser());
|
||||
$sudo = $this->getEnvOption('sudo', false);
|
||||
$host = $this->getWorkingHost();
|
||||
$host = $this->getHostName();
|
||||
$sshConfig = $this->getSSHConfig();
|
||||
|
||||
$cmdDelegate = $cmd;
|
||||
@@ -485,6 +485,17 @@ class Runtime
|
||||
return isset($info[1]) ? $info[1] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current Host Name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getHostName()
|
||||
{
|
||||
$info = explode(':', $this->getWorkingHost());
|
||||
return $info[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a Temporal File name
|
||||
*
|
||||
|
||||
@@ -36,7 +36,7 @@ class RsyncTask extends AbstractTask
|
||||
$flags = $this->runtime->getEnvOption('rsync', '-avz');
|
||||
$sshConfig = $this->runtime->getSSHConfig();
|
||||
$user = $this->runtime->getEnvOption('user', $this->runtime->getCurrentUser());
|
||||
$host = $this->runtime->getWorkingHost();
|
||||
$host = $this->runtime->getHostName();
|
||||
$hostPath = rtrim($this->runtime->getEnvOption('host_path'), '/');
|
||||
$targetDir = rtrim($hostPath, '/');
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ class CopyTask extends AbstractTask
|
||||
}
|
||||
|
||||
$user = $this->runtime->getEnvOption('user', $this->runtime->getCurrentUser());
|
||||
$host = $this->runtime->getWorkingHost();
|
||||
$host = $this->runtime->getHostName();
|
||||
$sshConfig = $sshConfig = $this->runtime->getSSHConfig();
|
||||
$hostPath = rtrim($this->runtime->getEnvOption('host_path'), '/');
|
||||
$currentReleaseId = $this->runtime->getReleaseId();
|
||||
|
||||
@@ -61,8 +61,8 @@ abstract class AbstractFileTask extends AbstractTask
|
||||
'%environment%' => $this->runtime->getEnvironment(),
|
||||
];
|
||||
|
||||
if ($this->runtime->getWorkingHost() !== null) {
|
||||
$mapping['%host%'] = $this->runtime->getWorkingHost();
|
||||
if ($this->runtime->getHostName() !== null) {
|
||||
$mapping['%host%'] = $this->runtime->getHostName();
|
||||
}
|
||||
|
||||
if ($this->runtime->getReleaseId() !== null) {
|
||||
|
||||
Reference in New Issue
Block a user