/** * Run added tasks * * @param string $target * @param Version $version */ public function build($target, Version $version) { $this->dispatch(BuilderEvents::BUILDER_PRE_BUILD); $tasks = $this->getSupportedTasks($target, $version); $this->taskRunner->setTasks($tasks); $this->taskRunner->execute($target, $version); $this->dispatch(BuilderEvents::BUILDER_POST_BUILD); }
/** * Execute tasks (if any) before undeployment is completed * * @param Context $context * * @return void */ protected function executeTasks(Context $context) { $target = $context->getTarget(); $version = $context->getVersion(); $strategy = $context->getStrategy(); $tasks = $this->getSupportedTasks($target, $version); $this->taskRunner->setTasks($tasks); if (true === $this->taskRunner->hasTasks()) { foreach ($this->taskRunner->getTasks() as $task) { if ($task instanceof SshTask) { $task->setOption('path', $strategy->getCurrentReleasePath()); } } $this->executeTaskrunner($context); } }