mirror of
https://github.com/andres-montanez/Magallanes
synced 2024-06-30 17:50:11 +02:00
Escape " from remote commands.
This commit is contained in:
parent
ad6f3cb6ee
commit
14b36eab88
|
@ -22,7 +22,7 @@ class Mage_Task_BuiltIn_Deployment_Release
|
||||||
|
|
||||||
// Fetch the user and group from base directory
|
// Fetch the user and group from base directory
|
||||||
$userGroup = '33:33';
|
$userGroup = '33:33';
|
||||||
$resultFetch = $this->_runRemoteCommand('ls -ld . | awk \'{print \$3\":\"\$4}\'', $userGroup);
|
$resultFetch = $this->_runRemoteCommand('ls -ld . | awk \'{print \$3":"\$4}\'', $userGroup);
|
||||||
|
|
||||||
// Remove symlink if exists; create new symlink and change owners
|
// Remove symlink if exists; create new symlink and change owners
|
||||||
$command = 'rm -f ' . $symlink
|
$command = 'rm -f ' . $symlink
|
||||||
|
|
|
@ -22,7 +22,7 @@ class Mage_Task_BuiltIn_Deployment_Rsync
|
||||||
|
|
||||||
if ($overrideRelease == true) {
|
if ($overrideRelease == true) {
|
||||||
$releaseToOverride = false;
|
$releaseToOverride = false;
|
||||||
$resultFetch = $this->_runRemoteCommand('ls -ld current | cut -d\"/\" -f2', $releaseToOverride);
|
$resultFetch = $this->_runRemoteCommand('ls -ld current | cut -d"/" -f2', $releaseToOverride);
|
||||||
if (is_numeric($releaseToOverride)) {
|
if (is_numeric($releaseToOverride)) {
|
||||||
$this->getConfig()->setReleaseId($releaseToOverride);
|
$this->getConfig()->setReleaseId($releaseToOverride);
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,7 +98,7 @@ class Mage_Task_BuiltIn_Releases_Rollback
|
||||||
Mage_Console::output('Running <purple>Rollback Release [id=' . $releaseId . ']</purple> ... ', 2, false);
|
Mage_Console::output('Running <purple>Rollback Release [id=' . $releaseId . ']</purple> ... ', 2, false);
|
||||||
|
|
||||||
$userGroup = '';
|
$userGroup = '';
|
||||||
$resultFetch = $this->_runRemoteCommand('ls -ld ' . $rollbackTo . ' | awk \'{print \$3\":\"\$4}\'', $userGroup);
|
$resultFetch = $this->_runRemoteCommand('ls -ld ' . $rollbackTo . ' | awk \'{print \$3":"\$4}\'', $userGroup);
|
||||||
$command = 'rm -f ' . $symlink
|
$command = 'rm -f ' . $symlink
|
||||||
. ' && '
|
. ' && '
|
||||||
. 'ln -sf ' . $rollbackTo . ' ' . $symlink
|
. 'ln -sf ' . $rollbackTo . ' ' . $symlink
|
||||||
|
|
|
@ -74,7 +74,7 @@ abstract class Mage_Task_TaskAbstract
|
||||||
. '-q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no '
|
. '-q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no '
|
||||||
. $this->_config->deployment('user') . '@' . $this->_config->getHostName() . ' '
|
. $this->_config->deployment('user') . '@' . $this->_config->getHostName() . ' '
|
||||||
. '"cd ' . rtrim($this->_config->deployment('to'), '/') . $releasesDirectory . ' && '
|
. '"cd ' . rtrim($this->_config->deployment('to'), '/') . $releasesDirectory . ' && '
|
||||||
. $command . '"';
|
. str_replace('"', '\"', $command) . '"';
|
||||||
|
|
||||||
return $this->_runLocalCommand($localCommand, $output);
|
return $this->_runLocalCommand($localCommand, $output);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue