diff --git a/Mage/Task/BuiltIn/Releases/RollbackTask.php b/Mage/Task/BuiltIn/Releases/RollbackTask.php
index 2eb87bc..9115883 100644
--- a/Mage/Task/BuiltIn/Releases/RollbackTask.php
+++ b/Mage/Task/BuiltIn/Releases/RollbackTask.php
@@ -108,7 +108,8 @@ class RollbackTask extends AbstractTask implements IsReleaseAware
$completedTasks = 0;
$tasksToRun = $this->getConfig()->getTasks();
$this->getConfig()->setReleaseId($releaseId);
-
+
+ // Run Deploy Tasks
foreach ($tasksToRun as $taskData) {
$task = Factory::get($taskData, $this->getConfig(), true, self::STAGE_DEPLOY);
$task->init();
@@ -151,6 +152,28 @@ class RollbackTask extends AbstractTask implements IsReleaseAware
Console::output('FAIL', 0);
}
+ // Run Post Release Tasks
+ $tasksToRun = $this->getConfig()->getTasks(AbstractTask::STAGE_POST_DEPLOY);
+ foreach ($tasksToRun as $taskData) {
+ $task = Factory::get($taskData, $this->getConfig(), true, self::STAGE_POST_DEPLOY);
+ $task->init();
+ Console::output('Running ' . $task->getName() . ' ... ', 2, false);
+
+ if ($task instanceOf RollbackAware) {
+ $tasks++;
+ $result = $task->run();
+
+ if ($result == true) {
+ Console::output('OK', 0);
+ $completedTasks++;
+ } else {
+ Console::output('FAIL', 0);
+ }
+ } else {
+ Console::output('SKIPPED', 0);
+ }
+ }
+
if ($completedTasks == $tasks) {
$tasksColor = 'green';
} else {
diff --git a/docs/example-config/.mage/config/environment/staging.yml b/docs/example-config/.mage/config/environment/staging.yml
index c3db3ef..2880d9e 100644
--- a/docs/example-config/.mage/config/environment/staging.yml
+++ b/docs/example-config/.mage/config/environment/staging.yml
@@ -12,15 +12,15 @@ releases:
directory: releases
hosts:
- localhost
-# - dbserver
+ - 127.0.0.1
tasks:
pre-deploy:
- - sampleTask
+# - sampleTask
# - failTask
- scm/update
on-deploy:
- privileges
- - sampleTask
+# - sampleTask
- sampleTaskRollbackAware
- taskWithParameters:
booleanOption: true