|
|
@ -125,7 +125,7 @@ class Mage_Console |
|
|
|
// Load Config |
|
|
|
// Load Config |
|
|
|
$config = new Mage_Config; |
|
|
|
$config = new Mage_Config; |
|
|
|
$config->loadGeneral(); |
|
|
|
$config->loadGeneral(); |
|
|
|
$config->loadEnvironment($this->getEnvironment()); |
|
|
|
$environmentOk = $config->loadEnvironment($this->getEnvironment()); |
|
|
|
$config->loadSCM(); |
|
|
|
$config->loadSCM(); |
|
|
|
|
|
|
|
|
|
|
|
// Logging |
|
|
|
// Logging |
|
|
@ -142,53 +142,66 @@ class Mage_Console |
|
|
|
Mage_Console::output('Starting <blue>Magallanes</blue>', 0, 2); |
|
|
|
Mage_Console::output('Starting <blue>Magallanes</blue>', 0, 2); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
switch ($this->getAction()) { |
|
|
|
if (!$environmentOk) { |
|
|
|
case 'deploy': |
|
|
|
Mage_Console::output('<red>You have selected an invalid environment</red>', 0, 2); |
|
|
|
$task = new Mage_Task_Deploy; |
|
|
|
|
|
|
|
$task->run($config); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case 'releases': |
|
|
|
|
|
|
|
$task = new Mage_Task_Releases; |
|
|
|
|
|
|
|
switch ($this->_args[1]) { |
|
|
|
|
|
|
|
case 'list': |
|
|
|
|
|
|
|
$task->setAction($this->_args[1]); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case 'rollback': |
|
|
|
} else { |
|
|
|
$task->setAction($this->_args[1]); |
|
|
|
switch ($this->getAction()) { |
|
|
|
$task->setRelease($this->_args[2]); |
|
|
|
case 'deploy': |
|
|
|
|
|
|
|
$task = new Mage_Task_Deploy; |
|
|
|
|
|
|
|
$task->run($config); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case 'releases': |
|
|
|
|
|
|
|
$task = new Mage_Task_Releases; |
|
|
|
|
|
|
|
if (!isset($this->_args[1])) { |
|
|
|
|
|
|
|
Mage_Console::output('<red>You must indicate a task</red>', 0, 2); |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
$task->run($config); |
|
|
|
switch ($this->_args[1]) { |
|
|
|
break; |
|
|
|
case 'list': |
|
|
|
|
|
|
|
$task->setAction($this->_args[1]); |
|
|
|
case 'update'; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case 'rollback': |
|
|
|
|
|
|
|
if (!isset($this->_args[2])) { |
|
|
|
|
|
|
|
Mage_Console::output('<red>You must indicate a release point</red>', 0, 2); |
|
|
|
|
|
|
|
break 2; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$task->setAction($this->_args[1]); |
|
|
|
|
|
|
|
$task->setRelease($this->_args[2]); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
$task->run($config); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case 'update'; |
|
|
|
$task = new Mage_Task_Update; |
|
|
|
$task = new Mage_Task_Update; |
|
|
|
$task->run($config); |
|
|
|
$task->run($config); |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case 'compile'; |
|
|
|
case 'compile'; |
|
|
|
$task = new Mage_Task_Compile; |
|
|
|
$task = new Mage_Task_Compile; |
|
|
|
$task->run($config); |
|
|
|
$task->run($config); |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case 'install'; |
|
|
|
case 'install'; |
|
|
|
$task = new Mage_Task_Install; |
|
|
|
$task = new Mage_Task_Install; |
|
|
|
$task->run(); |
|
|
|
$task->run(); |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case 'upgrade'; |
|
|
|
case 'upgrade'; |
|
|
|
$task = new Mage_Task_Upgrade; |
|
|
|
$task = new Mage_Task_Upgrade; |
|
|
|
$task->run(); |
|
|
|
$task->run(); |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case 'init'; |
|
|
|
case 'init'; |
|
|
|
$task = new Mage_Task_Init; |
|
|
|
$task = new Mage_Task_Init; |
|
|
|
$task->run(); |
|
|
|
$task->run(); |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case 'add'; |
|
|
|
case 'add'; |
|
|
|
switch ($this->_args[1]) { |
|
|
|
switch ($this->_args[1]) { |
|
|
|
case 'environment': |
|
|
|
case 'environment': |
|
|
|
if (isset($this->_args[3]) && ($this->_args[3] == '--with-releases')) { |
|
|
|
if (isset($this->_args[3]) && ($this->_args[3] == '--with-releases')) { |
|
|
@ -203,13 +216,14 @@ class Mage_Console |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case 'version'; |
|
|
|
case 'version'; |
|
|
|
$this->showVersion(); |
|
|
|
$this->showVersion(); |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
default: |
|
|
|
default: |
|
|
|
Mage_Console::output('<red>Invalid action</red>', 0, 2); |
|
|
|
Mage_Console::output('<red>Invalid action</red>', 0, 2); |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if ($showGrettings) { |
|
|
|
if ($showGrettings) { |
|
|
|