mirror of
https://github.com/hauke68/Magallanes.git
synced 2026-08-29 10:38:57 +02:00
Major overhauling and refactoring of Magallanes Command and Tasks modulairty and workflow.
ADVICE: there is no Backwards Compatibility with custom tasks, those using the _config instance will be broken or those using the getEnvironmentName().
This commit is contained in:
+10
-15
@@ -4,47 +4,42 @@ abstract class Mage_Task_TaskAbstract
|
||||
protected $_config = null;
|
||||
protected $_inRollback = false;
|
||||
protected $_stage = null;
|
||||
|
||||
|
||||
public abstract function getName();
|
||||
|
||||
|
||||
public abstract function run();
|
||||
|
||||
|
||||
public final function __construct(Mage_Config $config, $inRollback = false, $stage = null)
|
||||
{
|
||||
$this->_config = $config;
|
||||
$this->_inRollback = $inRollback;
|
||||
$this->_stage = $stage;
|
||||
}
|
||||
|
||||
|
||||
public function inRollback()
|
||||
{
|
||||
return $this->_inRollback;
|
||||
}
|
||||
|
||||
|
||||
public function getStage()
|
||||
{
|
||||
return $this->_stage;
|
||||
}
|
||||
|
||||
|
||||
public function getConfig()
|
||||
{
|
||||
return $this->_config;
|
||||
}
|
||||
|
||||
public function getActionOption($name, $value = false)
|
||||
{
|
||||
return Mage_Console::getActionOption($name, $value);
|
||||
}
|
||||
|
||||
|
||||
public function init()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
protected final function _runLocalCommand($command, &$output = null)
|
||||
{
|
||||
return Mage_Console::executeCommand($command, $output);
|
||||
}
|
||||
|
||||
|
||||
protected final function _runRemoteCommand($command, &$output = null)
|
||||
{
|
||||
if ($this->_config->release('enabled', false) == true) {
|
||||
@@ -61,7 +56,7 @@ abstract class Mage_Task_TaskAbstract
|
||||
} else {
|
||||
$releasesDirectory = '';
|
||||
}
|
||||
|
||||
|
||||
$localCommand = 'ssh -p ' . $this->_config->getHostPort() . ' '
|
||||
. '-q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no '
|
||||
. $this->_config->deployment('user') . '@' . $this->_config->getHostName() . ' '
|
||||
|
||||
Reference in New Issue
Block a user