1
0
mirror of https://github.com/hauke68/Magallanes.git synced 2025-08-26 05:10:17 +02:00

If remote command is executed, run it inside the current release; if releases is enabled.

This commit is contained in:
Andrs Montaez 2012-02-04 15:48:15 -02:00
parent bff9e1a8ef
commit 4015ccc984

View File

@ -30,9 +30,18 @@ abstract class Mage_Task_TaskAbstract
protected final function _runRemoteCommand($command, &$output = null)
{
if ($this->_config->release('enabled', false) == true) {
$releasesDirectory = '/'
. $this->_config->release('directory', 'releases')
. '/'
. $this->_config->getReleaseId();
} else {
$releasesDirectory = '';
}
$localCommand = 'ssh '
. $this->_config->deployment('user') . '@' . $this->_config->getHost() . ' '
. '"cd ' . $this->_config->deployment('to') . ' && '
. '"cd ' . rtrim($this->_config->deployment('to'), '/') . $releasesDirectory . ' && '
. $command . '"';
return $this->_runLocalCommand($localCommand, $output);