コード例 #1
0
ファイル: UpdateCommand.php プロジェクト: jousch/clitools
 /**
  * Run user update
  *
  * @param  InputInterface  $input  Input instance
  * @param  OutputInterface $output Output instance
  *
  * @return int|null|void
  */
 protected function userUpdate(InputInterface $input, OutputInterface $output)
 {
     // GIT pulls and other stuff
     // ##################
     // SSH Git repo update
     // ##################
     $reposDirectory = $this->getApplication()->getConfigValue('config', 'ssh_conf_path', '/opt/conf/ssh');
     if (is_dir($reposDirectory) && is_dir($reposDirectory . '/.git')) {
         // SSH Git repo exists, update now
         $originalCwd = getcwd();
         \CliTools\Utility\PhpUtility::chdir($reposDirectory);
         try {
             // Update git repository
             $this->outputBlock($output, 'Running git update of ' . $reposDirectory);
             $command = new CommandBuilder('git', 'pull');
             $command->executeInteractive();
             $command = new \CliTools\Shell\CommandBuilder\SelfCommandBuilder();
             $command->addArgument('user:rebuildsshconfig');
             $command->executeInteractive();
         } catch (\RuntimeException $e) {
             $msg = 'Running git update of ' . $reposDirectory . '... FAILED';
             $output->writeln('<error>' . $msg . '</error>');
         }
         \CliTools\Utility\PhpUtility::chdir($originalCwd);
     }
 }
コード例 #2
0
ファイル: CreateCommand.php プロジェクト: jousch/clitools
 /**
  * Build and startup docker instance
  *
  * @param string $path Path
  */
 protected function startDockerInstance($path)
 {
     $this->setTerminalTitle('Start docker');
     $this->output->writeln('<comment>Building docker containers "' . $path . '"</comment>');
     PhpUtility::chdir($path);
     $command = new SelfCommandBuilder();
     $command->addArgument('docker:up');
     $command->executeInteractive();
 }