/** * Executes this command. * * @param InputInterface $input * @param OutputInterface $output */ protected function execute(InputInterface $input, OutputInterface $output) { $parameters = new ParameterBag(); $parameters->set('configuration.file', $input->getOption('project-dir') . DIRECTORY_SEPARATOR . 'accompli.json'); $parameters->set('console.output_interface', $output); $accompli = new Accompli($parameters); $accompli->initialize(); $successfulInstall = $accompli->deploy($input->getArgument('version'), $input->getArgument('stage')); if ($successfulInstall) { return 0; } return 1; }
/** * Interacts with the user to retrieve the configuration for an accompli.json file. * * @param InputInterface $input * @param OutputInterface $output */ protected function interact(InputInterface $input, OutputInterface $output) { $io = $this->getIO($input, $output); $io->write(Accompli::LOGO); $io->writeln(' ========================='); $io->writeln(' Configuration generator'); $io->writeln(' ========================='); $accompli = new Accompli(new ParameterBag()); $accompli->initializeStreamWrapper(); $recipe = $io->choice('Select a recipe to extend from', $this->getAvailableRecipes(), 'defaults.json'); if ($recipe === 'Other') { $this->configuration['$extend'] = $io->ask('Enter the path to the recipe'); } elseif ($recipe === 'None') { unset($this->configuration['$extend']); } else { $this->configuration['$extend'] = 'accompli://recipe/' . $recipe; } $this->interactForHostConfigurations($io); $this->interactForTaskConfigurations($io); $io->writeln(' The generator will create the following configuration:'); $io->writeln($this->getJsonEncodedConfiguration()); $io->confirm('Do you wish to continue?'); }