private function launchInstance() { $instanceIds = $this->instance->launch(); try { $host = $this->instance->setup($instanceIds); $this->instance->verifySetup($instanceIds); } catch (\Exception $e) { $this->instance->terminate($instanceIds); throw new \RuntimeException('We failed to launch a new instance so we terminated it directly. Try again! Error Message: ' . $e->getMessage()); } return $host; }
private function launchInstance(OutputInterface $output, $useOneInstancePerTestSuite, Config $awsConfig, $testSuite) { $awsInstance = new Instance($awsConfig, $testSuite); if ($useOneInstancePerTestSuite) { $awsInstance->enableUseOneInstancePerTestSuite(); } $launcher = new InstanceLauncher($awsInstance); $host = $launcher->launchOrResumeInstance(); $output->writeln(sprintf("Access instance using <comment>ssh -i %s ubuntu@%s</comment>", $awsConfig->getPemFile(), $host)); $output->writeln("You can log in to Piwik via root:secure at <comment>http://{$host}</comment>"); $output->writeln("You can access database via root:secure (<comment>mysql -uroot -psecure</comment>)"); $output->writeln("Files are located in <comment>~/www/piwik</comment>"); $output->writeln(' '); return $host; }