mirror of
https://github.com/deployphp/deployer.git
synced 2025-02-24 09:12:51 +01:00
Feature: interop env on localhost with once().
This commit is contained in:
parent
2959ecaa72
commit
afba2ec798
@ -120,6 +120,16 @@ class ParallelExecutor implements ExecutorInterface
|
||||
*/
|
||||
private $hasNonFatalException = false;
|
||||
|
||||
/**
|
||||
* @var Local
|
||||
*/
|
||||
private $localhost;
|
||||
|
||||
/**
|
||||
* @var Environment
|
||||
*/
|
||||
private $localEnv;
|
||||
|
||||
/**
|
||||
* @param InputDefinition $userDefinition
|
||||
*/
|
||||
@ -139,6 +149,8 @@ class ParallelExecutor implements ExecutorInterface
|
||||
$this->input = $input;
|
||||
$this->output = new OutputWatcher($output);
|
||||
$this->informer = new Informer($this->output);
|
||||
$this->localhost = new Local();
|
||||
$this->localEnv = new Environment();
|
||||
$this->port = self::START_PORT;
|
||||
|
||||
connect:
|
||||
@ -292,7 +304,7 @@ class ParallelExecutor implements ExecutorInterface
|
||||
$this->informer->startTask($taskName);
|
||||
|
||||
if ($task->isOnce()) {
|
||||
$task->run(new Context(new Local(), new Environment(), $this->input, $this->output));
|
||||
$task->run(new Context($this->localhost, $this->localEnv, $this->input, $this->output));
|
||||
$this->informer->endTask();
|
||||
} else {
|
||||
$this->tasksToDo = [];
|
||||
|
@ -22,13 +22,15 @@ class SeriesExecutor implements ExecutorInterface
|
||||
{
|
||||
$output = new OutputWatcher($output);
|
||||
$informer = new Informer($output);
|
||||
$localhost = new Local();
|
||||
$localEnv = new Environment();
|
||||
|
||||
foreach ($tasks as $task) {
|
||||
$success = true;
|
||||
$informer->startTask($task->getName());
|
||||
|
||||
if ($task->isOnce()) {
|
||||
$task->run(new Context(new Local(), new Environment(), $input, $output));
|
||||
$task->run(new Context($localhost, $localEnv, $input, $output));
|
||||
} else {
|
||||
foreach ($servers as $serverName => $server) {
|
||||
if ($task->isOnServer($serverName)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user