mirror of
https://github.com/hauke68/Magallanes.git
synced 2026-08-28 10:08:56 +02:00
Changes on console feedback colors. Example of User Tasks.
This commit is contained in:
+15
-9
@@ -7,30 +7,36 @@ class Mage_Task_Deploy
|
||||
{
|
||||
$this->_config = $config;
|
||||
|
||||
foreach ($config->getHosts() as $host)
|
||||
{
|
||||
foreach ($config->getHosts() as $host) {
|
||||
$taskConfig = $config->getConfig($host);
|
||||
$tasks = 0;
|
||||
$completedTasks = 0;
|
||||
|
||||
Mage_Console::output(PHP_TAB . 'Deploying to ' . $host . PHP_EOL);
|
||||
Mage_Console::output('Deploying to <dark_gray>' . $host . '</dark_gray>');
|
||||
|
||||
foreach ($config->getTasks() as $taskName) {
|
||||
$tasks++;
|
||||
$task = Mage_Task_Factory::get($taskName);
|
||||
$task = Mage_Task_Factory::get($taskName, $taskConfig);
|
||||
$task->init();
|
||||
|
||||
Mage_Console::output(PHP_TAB . PHP_TAB . 'Running ' . $task->getName() . ' ... ');
|
||||
$result = $task->run($taskConfig);
|
||||
Mage_Console::output('Running <purple>' . $task->getName() . '</purple> ... ', 2, false);
|
||||
$result = $task->run();
|
||||
|
||||
if ($result == true) {
|
||||
Mage_Console::output(PHP_TAB . 'OK' . PHP_EOL);
|
||||
Mage_Console::output('<green>OK</green>');
|
||||
$completedTasks++;
|
||||
} else {
|
||||
Mage_Console::output(PHP_TAB . 'FAIL' . PHP_EOL);
|
||||
Mage_Console::output('<red>FAIL</red>');
|
||||
}
|
||||
}
|
||||
|
||||
if ($completedTasks == $tasks) {
|
||||
$tasksColor = 'green';
|
||||
} else {
|
||||
$tasksColor = 'red';
|
||||
}
|
||||
|
||||
Mage_Console::output(PHP_TAB . 'Deployment to ' . $host . ' compted: ' . $completedTasks . '/' . $tasks . ' tasks done.' . PHP_EOL . PHP_EOL);
|
||||
Mage_Console::output('Deployment to <dark_gray>' . $host . '</dark_gray> compted: <' . $tasksColor . '>' . $completedTasks . '/' . $tasks . '</' . $tasksColor . '> tasks done.' . PHP_EOL . PHP_EOL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user