diff --git a/Mage/Console.php b/Mage/Console.php index 067c616..cedd190 100644 --- a/Mage/Console.php +++ b/Mage/Console.php @@ -83,8 +83,7 @@ class Mage_Console { self::log('---------------------------------'); self::log('---- Executing: $ ' . $command); - - ob_start(); + $return = 1; $log = array(); exec($command . ' 2>&1', $log, $return); diff --git a/Mage/Task/BuiltIn/Deployment/Releases.php b/Mage/Task/BuiltIn/Deployment/Releases.php index a39c341..d4ec3c6 100644 --- a/Mage/Task/BuiltIn/Deployment/Releases.php +++ b/Mage/Task/BuiltIn/Deployment/Releases.php @@ -22,7 +22,7 @@ class Mage_Task_BuiltIn_Deployment_Releases . ' && ' . 'ln -sf ' . $currentCopy . ' ' . $symlink . ' && ' - . 'chown -h ' . $userGroup . ' ' . $symlink; + . 'chown -h ' . $userGroup . ' ' . $symlink; $result = $this->_runRemoteCommand($command); return $result; diff --git a/Mage/Task/BuiltIn/Scm/Clone.php b/Mage/Task/BuiltIn/Scm/Clone.php index 55384e7..46c4b35 100644 --- a/Mage/Task/BuiltIn/Scm/Clone.php +++ b/Mage/Task/BuiltIn/Scm/Clone.php @@ -29,11 +29,16 @@ class Mage_Task_BuiltIn_Scm_Clone $this->_runLocalCommand('mkdir -p ' . $this->_source['temporal']); switch ($this->_source['type']) { case 'git': - $command = 'cd ' . $this->_source['temporal'] - . ' && ' - . 'git clone ' . $this->_source['repository'] . ' . ' - . ' && ' + // Clone Repo + $command = 'cd ' . $this->_source['temporal'] . ' ; ' + . 'git clone ' . $this->_source['repository'] . ' . '; + $result = $this->_runLocalCommand($command); + + // Checkout Branch + $command = 'cd ' . $this->_source['temporal'] . ' ; ' . 'git checkout ' . $this->_source['from']; + $result = $result && $this->_runLocalCommand($command); + $this->_config->setFrom($this->_source['temporal']); break; @@ -41,8 +46,6 @@ class Mage_Task_BuiltIn_Scm_Clone return false; break; } - - $result = $this->_runLocalCommand($command); return $result; } diff --git a/Mage/Task/TaskAbstract.php b/Mage/Task/TaskAbstract.php index 77d3e78..d9f91ad 100644 --- a/Mage/Task/TaskAbstract.php +++ b/Mage/Task/TaskAbstract.php @@ -45,7 +45,7 @@ abstract class Mage_Task_TaskAbstract $releasesDirectory = ''; } - $localCommand = 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ' + $localCommand = 'ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ' . $this->_config->deployment('user') . '@' . $this->_config->getHost() . ' ' . '"cd ' . rtrim($this->_config->deployment('to'), '/') . $releasesDirectory . ' && ' . $command . '"';