_config = $config;
foreach ($config->getHosts() as $host) {
$taskConfig = $config->getConfig($host);
$tasks = 0;
$completedTasks = 0;
Mage_Console::output('Deploying to ' . $host . '');
foreach ($config->getTasks() as $taskName) {
$tasks++;
$task = Mage_Task_Factory::get($taskName, $taskConfig);
$task->init();
Mage_Console::output('Running ' . $task->getName() . ' ... ', 2, false);
$result = $task->run();
if ($result == true) {
Mage_Console::output('OK');
$completedTasks++;
} else {
Mage_Console::output('FAIL');
}
}
if ($completedTasks == $tasks) {
$tasksColor = 'green';
} else {
$tasksColor = 'red';
}
Mage_Console::output('Deployment to ' . $host . ' compted: <' . $tasksColor . '>' . $completedTasks . '/' . $tasks . '' . $tasksColor . '> tasks done.' . PHP_EOL . PHP_EOL);
}
}
}