From 86ef2786070f78f23ef2e779709719576209e7bc Mon Sep 17 00:00:00 2001 From: juanda Date: Wed, 7 May 2014 12:55:14 +0200 Subject: [PATCH] strategy git-rebase is enabled --- Mage/Command/BuiltIn/DeployCommand.php | 6 +++++- .../Task/BuiltIn/Deployment/Strategy/GitRebaseTask.php | 10 +++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Mage/Command/BuiltIn/DeployCommand.php b/Mage/Command/BuiltIn/DeployCommand.php index 916d546..cbc9c51 100644 --- a/Mage/Command/BuiltIn/DeployCommand.php +++ b/Mage/Command/BuiltIn/DeployCommand.php @@ -310,7 +310,11 @@ class DeployCommand extends AbstractCommand implements RequiresEnvironment case 'targz': $deployStrategy = 'deployment/strategy/tar-gz'; break; - + + case 'git-rebase': + $deployStrategy = 'deployment/strategy/git-rebase'; + break; + case 'guess': default: if ($this->getConfig()->release('enabled', false) == true) { diff --git a/Mage/Task/BuiltIn/Deployment/Strategy/GitRebaseTask.php b/Mage/Task/BuiltIn/Deployment/Strategy/GitRebaseTask.php index 56afa57..5bcbd8e 100644 --- a/Mage/Task/BuiltIn/Deployment/Strategy/GitRebaseTask.php +++ b/Mage/Task/BuiltIn/Deployment/Strategy/GitRebaseTask.php @@ -34,13 +34,13 @@ class GitRebaseTask extends AbstractTask implements IsReleaseAware * @see \Mage\Task\AbstractTask::run() */ public function run() - { - $branch = $this->getParameter('branch'); - $remote = $this->getParameter('remote'); - + { + $branch = $this->getParameter('branch', 'master'); + $remote = $this->getParameter('remote', 'origin'); + // Fetch Remote $command = 'git fetch ' . $remote; - $result = $this->runCommandRemote($command) && $result; + $result = $this->runCommandRemote($command); // Checkout $command = 'git checkout ' . $branch;