/**
  * {@inheritdoc}
  */
 public function start(Project $project)
 {
     if (!$this->inHomeDirectory()) {
         throw new ProjectException('The project have to be in your home directly to be able to share it with the Docker VM');
     }
     return $this->projectManager->start($project);
 }
Esempio n. 2
0
 /**
  * {@inheritdoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     try {
         $this->projectManager->start($this->project);
     } catch (ProjectException $e) {
         $output->writeln('<error>' . $e->getMessage() . '</error>');
         return 1;
     }
     return $this->getApplication()->run(new ArrayInput(['command' => 'ps']), $output);
 }
 /**
  * {@inheritdoc}
  */
 public function start(Project $project)
 {
     $hostnameConfigurations = $this->hostnameResolver->getExtraHostnameConfigurations($project);
     foreach ($hostnameConfigurations as $configuration) {
         $container = $this->inspector->findOneByName($configuration->getContainer());
         $ipAddress = $container->getIpAddress();
         if (empty($ipAddress)) {
             throw new \RuntimeException(sprintf('The container "%s" has an empty address', $container->getName()));
         }
         $this->hostnameResolutionWriter->write($configuration->getHostname(), $ipAddress);
     }
     $this->projectManager->start($project);
 }
 /**
  * {@inheritdoc}
  */
 public function start(Project $project)
 {
     try {
         $this->doctor->examine(new NullOutput(), true);
     } catch (CommandFailedException $e) {
         if (!$this->userInteraction instanceof ConsoleUserInteraction) {
             throw $e;
         }
         $answer = $this->userInteraction->ask(new Question('It looks like there\'s something wrong with your installation. Would you like to run the `doctor` command ? [Yn]', 'y'));
         if ('y' == strtolower($answer)) {
             $this->doctor->examine($this->userInteraction->getOutput(), false);
         }
     }
     return $this->projectManager->start($project);
 }