diff --git a/Mage/Command/BuiltIn/Deploy.php b/Mage/Command/BuiltIn/Deploy.php index eca4e78..27ecabb 100644 --- a/Mage/Command/BuiltIn/Deploy.php +++ b/Mage/Command/BuiltIn/Deploy.php @@ -15,6 +15,7 @@ class Mage_Command_BuiltIn_Deploy public function run() { $this->getConfig()->setReleaseId(date('YmdHis')); + $failedTasks = 0; $this->_startTime = time(); @@ -57,6 +58,8 @@ class Mage_Command_BuiltIn_Deploy if ($this->_runTask($task)) { $completedTasks++; + } else { + $failedTasks++; } } @@ -71,6 +74,11 @@ class Mage_Command_BuiltIn_Deploy } $this->_endTimeHosts = time(); + if ($failedTasks > 0) { + Mage_Console::output('A total of ' . $failedTasks . ' deployment tasks failed: ABORTING', 1, 2); + return; + } + // Releasing if ($this->getConfig()->release('enabled', false) == true) { // Execute the Releases @@ -201,7 +209,7 @@ class Mage_Command_BuiltIn_Deploy } else { Mage_Console::output('FAIL', 0); - $result = true; + $result = false; } } catch (Mage_Task_SkipException $e) { Mage_Console::output('SKIPPED', 0); diff --git a/docs/example-config/.mage/tasks/TaskWithParameters.php b/docs/example-config/.mage/tasks/TaskWithParameters.php index 2e9b489..41ab45e 100644 --- a/docs/example-config/.mage/tasks/TaskWithParameters.php +++ b/docs/example-config/.mage/tasks/TaskWithParameters.php @@ -15,7 +15,8 @@ class Task_TaskWithParameters public function run() { - throw new Mage_Task_SkipException; + //throw new Mage_Task_SkipException; + //return false; return true; } } \ No newline at end of file