Beispiel #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)
 {
     $machine = $input->getArgument('machine');
     $path_machine = gestao_path_vms() . DIRECTORY_SEPARATOR . $machine;
     chdir($path_machine);
     passthru('vagrant ssh');
 }
Beispiel #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)
 {
     $machine = $input->getArgument('machine');
     $command = 'vagrant init gestao-ti/' . $machine;
     $path_machine = gestao_path_vms() . DIRECTORY_SEPARATOR . $machine;
     $this->basePathMachine = gestao_path_vms() . DIRECTORY_SEPARATOR . $machine;
     if (is_dir($path_machine)) {
         throw new InvalidArgumentException($machine . ' has already been initialized.');
     }
     mkdir($path_machine, 0777, true);
     (new InitCommand())->execute($input, $output);
     if (!file_exists($path_machine . '/Gestao.yaml')) {
         copy(__DIR__ . '/stubs/Gestao.yaml', $path_machine . '/Gestao.yaml');
         $this->updateName($machine);
         $output->writeln('==> Gestao: Creating Gestao.yaml file...');
     }
     if (!file_exists($path_machine . '/after.sh')) {
         copy(__DIR__ . '/stubs/after.sh', $path_machine . '/after.sh');
         $output->writeln('==> Gestao: Creating after.sh file...');
     }
     if (!file_exists($path_machine . '/aliases.sh')) {
         copy(__DIR__ . '/stubs/aliases', $path_machine . '/aliases');
         $output->writeln('==> Gestao: Creating aliases file...');
     }
     if (!file_exists($path_machine . '/Vagrantfile')) {
         copy(__DIR__ . '/stubs/Vagrantfile', $path_machine . '/Vagrantfile');
         $output->writeln('==> Gestao: Creating Vagrantfile file...');
     }
     $output->writeln('==> Gestao: Virtual Machine <info>gestao-ti/' . $machine . '</info>');
 }
 /**
  * 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)
 {
     $machine = $input->getArgument('machine');
     $command = 'vagrant provision';
     $path_machine = gestao_path_vms() . DIRECTORY_SEPARATOR . $machine;
     $process = new Process($command, $path_machine, null, null, null);
     $process->run(function ($type, $line) use($output, $machine, $path_machine) {
         $output->write($line);
     });
 }
 /**
  * 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)
 {
     $machine = $input->getArgument('machine');
     $command = 'vagrant box update';
     $path_machine = gestao_path_vms() . DIRECTORY_SEPARATOR . $machine;
     $process = new Process($command, $path_machine, array_merge($_SERVER, $_ENV), null, null);
     $process->run(function ($type, $line) use($output, $machine, $path_machine) {
         $output->write($line);
         $output->writeln('<comment>==> Gestao: Machine ' . $machine . ' updated:</comment>');
     });
 }
Beispiel #5
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)
 {
     $machine = $input->getArgument('machine');
     $path_machine = gestao_path_vms() . DIRECTORY_SEPARATOR . $machine;
     $command = "vagrant package --output {$machine}.box";
     $process = new Process($command, $path_machine, null, null, null);
     $process->run(function ($type, $line) use($output, $machine, $path_machine) {
         $output->write($line);
     });
     $output->writeln("==> Gestao: Package created: {$path_machine}/{$machine}.box");
 }
Beispiel #6
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)
 {
     $machine = $input->getArgument('machine');
     $command = 'vagrant destroy --force';
     $path_machine = gestao_path_vms() . DIRECTORY_SEPARATOR . $machine;
     $process = new Process($command, $path_machine, null, null, null);
     $process->run(function ($type, $line) use($output) {
         $output->write($line);
     });
     passthru("rm -rf {$path_machine}");
     $output->writeln('==> Gestao: Machine ' . $machine . ' destroyed');
 }
Beispiel #7
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)
 {
     $machine = $input->getArgument('machine');
     $command = 'vagrant up';
     $path_machine = gestao_path_vms() . DIRECTORY_SEPARATOR . $machine;
     if (!is_dir($path_machine)) {
         (new VmInitCommand())->execute($input, $output);
     }
     $process = new Process($command, $path_machine, array_merge($_SERVER, $_ENV), null, null);
     $process->run(function ($type, $line) use($output, $machine, $path_machine) {
         $output->write($line);
     });
 }
Beispiel #8
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)
 {
     $file = 'Gestao.yaml';
     $machine = $input->getArgument('machine');
     $path_machine = gestao_path_vms() . DIRECTORY_SEPARATOR . $machine;
     if (!is_dir($path_machine)) {
         (new VmInitCommand())->execute($input, $output);
     }
     $command = $this->executable($path_machine . DIRECTORY_SEPARATOR . $file);
     $process = new Process($command, $path_machine, null, null, null);
     $process->run(function ($type, $line) use($output) {
         $output->write($line);
     });
 }