/** * {@inheritdoc} */ protected function execute(InputInterface $input, OutputInterface $output) { $acronym = $input->getArgument('acronym'); $database = new ProjectDatabase(Application::getDatabase()); try { $project = $database->getProjectByAcronym($acronym); $database->removeProject($project); $output->writeln(sprintf('<info>Successfully</info> unregistered project <info>%s</info>', $acronym)); } catch (DatabaseQueryException $e) { $output->writeln(sprintf('<error>%s</error>', $e->getMessage())); } }
/** * {@inheritdoc} */ protected function execute(InputInterface $input, OutputInterface $output) { // Get the project. $database = new ProjectDatabase(Application::getDatabase()); $acronym = $input->getArgument('project_acronym'); $project = null; try { $project = $database->getProjectByAcronym($input->getArgument('project_acronym')); Application::getDocker()->removeEnvironment($project, $input->getArgument('feature_branch')); } catch (DatabaseQueryException $e) { $output->writeln(sprintf('Unable to find <error>project</error> by acronym <error>%s</error>.', $acronym)); } }
protected function execute(InputInterface $input, OutputInterface $output) { // Read in the arguments. $acronym = $input->getArgument('project_acronym'); $branch = $input->getArgument('feature_branch'); $installProfile = $input->getArgument('drupal_install_profile'); $project = null; try { // Get the project. $projectDatabase = new ProjectDatabase(Application::getDatabase()); $project = $projectDatabase->getProjectByAcronym($input->getArgument('project_acronym')); // Create the docker environment. Application::getDocker()->createEnvironment($project, $branch, $installProfile); } catch (DockerManagerCreateEnvironmentException $e) { $output->writeln(sprintf('<error>Failed</error> to create <error>environment</error> [project: %s, branch: %s]', $acronym, $branch)); } catch (DatabaseQueryException $e) { $output->writeln(sprintf('Unable to find <error>project</error> by acronym <error>%s</error>.', $acronym)); } }
/** * {@inheritdoc} */ protected function execute(InputInterface $input, OutputInterface $output) { // Get all projects. try { $database = new ProjectDatabase(Application::getDatabase()); $projects = $database->getProjects(); if ($projects == array()) { $output->writeln('<comment>Currently there are no projects registered.</comment>'); return; } $table = new Table($output); $table->setHeaders(['ID', 'Project', 'Acronym', 'Git URL', 'Web URL']); foreach ($projects as $project) { $table->addRow([$project->getId(), $project->getFullName(), $project->getShortName(), $project->getGitRepositoryUrl(), 'http://' . $project->getVhostName()]); } $table->render(); } catch (DatabaseQueryException $e) { $output->writeln('<error>Failed to retrieve list of registered projects from database.</error>'); } }