mirror of
https://github.com/andres-montanez/Magallanes
synced 2024-06-27 09:40:04 +02:00
Allows to guess where a command should be executed (remote or local) based on the stage of the task.
This commit is contained in:
parent
1653b6354d
commit
6f6cf2436a
|
@ -131,7 +131,7 @@ abstract class AbstractTask
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Runs a Shell Command Locally
|
* Runs a Shell Command Localy
|
||||||
* @param string $command
|
* @param string $command
|
||||||
* @param string $output
|
* @param string $output
|
||||||
* @return boolean
|
* @return boolean
|
||||||
|
@ -172,4 +172,20 @@ abstract class AbstractTask
|
||||||
|
|
||||||
return $this->runCommandLocal($localCommand, $output);
|
return $this->runCommandLocal($localCommand, $output);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Runs a Shell Command Localy or in the Remote Host based on the Task Stage.
|
||||||
|
* If the stage is "deploy" then it will be executed in the remote host.
|
||||||
|
* @param string $command
|
||||||
|
* @param string $output
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
protected final function runCommand($command, &$output = null)
|
||||||
|
{
|
||||||
|
if ($this->getStage() == 'deploy') {
|
||||||
|
return $this->runCommandRemote($command, $output);
|
||||||
|
} else {
|
||||||
|
return $this->runCommandLocal($command, $output);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue