예제 #1
0
 /**
  * Execute the command.
  *
  * @param  \Symfony\Component\Console\Input\InputInterface  $input
  * @param  \Symfony\Component\Console\Output\OutputInterface  $output
  * @return void
  */
 public function execute(InputInterface $input, OutputInterface $output)
 {
     $name = $input->getArgument('name');
     $config = $input->getOption('config') ?: 'default';
     $data = DataInteractor::load($config);
     if (!array_key_exists($name, $data)) {
         $output->writeln('<error>A deployment with the name ' . $name . ' doesn\'t exist!</error>');
         return;
     }
     unset($data[$name]);
     DataInteractor::save($data, $config);
     $output->writeln('<info>' . $name . ' has been deleted from the ' . $config . ' config!</info>');
 }
예제 #2
0
 /**
  * Execute the command.
  *
  * @param  \Symfony\Component\Console\Input\InputInterface  $input
  * @param  \Symfony\Component\Console\Output\OutputInterface  $output
  * @return void
  */
 public function execute(InputInterface $input, OutputInterface $output)
 {
     $name = $input->getArgument('name');
     $endpoint = $input->getArgument('endpoint');
     $config = $input->getOption('config') ?: 'default';
     $data = DataInteractor::load($config);
     if (array_key_exists($name, $data)) {
         $output->writeln('<error>A deployment with the name ' . $name . ' already exists!</error>');
         return;
     }
     $data[$name] = $endpoint;
     DataInteractor::save($data, $config);
     $output->writeln('<info>' . $name . ' has been saved to the ' . $config . ' config!</info>');
 }
예제 #3
0
 /**
  * Execute the command.
  *
  * @param  \Symfony\Component\Console\Input\InputInterface  $input
  * @param  \Symfony\Component\Console\Output\OutputInterface  $output
  * @return void
  */
 public function execute(InputInterface $input, OutputInterface $output)
 {
     $name = $input->getArgument('name');
     $config = $input->getOption('config') ?: 'default';
     $data = DataInteractor::load($config);
     if (!array_key_exists($name, $data)) {
         $output->writeln('<error>A deployment with the name ' . $name . ' doesn\'t exist!</error>');
         return;
     }
     $client = new Client();
     $response = $client->get($data[$name]);
     if ($response->getStatusCode() !== 200) {
         $output->writeln('<error>The endpoint returned an non-200 response!</error>');
         $output->writeln('<comment>Deployment may not of occurred.</comment>');
         return;
     }
     $output->writeln('<info>' . $name . ' has been deployed for the ' . $config . ' config!</info>');
 }