Пример #1
0
 /**
  * @param GitSimpleWrapper $gitSimpleWrapper
  * @param $branch
  * @return mixed
  */
 public function pullOriginActiveBranch(GitSimpleWrapper $gitSimpleWrapper, $branch)
 {
     return $gitSimpleWrapper->git("pull origin " . $branch);
 }
Пример #2
0
     exec($this->phpBinary . ' ' . \Padosoft\Workbench\Parameters\Dir::adjustPath(Config::get('workbench.common_dev_lib_path')) . 'apigen.phar generate --source ' . $source . ' --destination ' . $destination . '/dev-master');
     File::copyDirectory($destination . '/dev-master/resources/', $destination . '/resources/');
     $readmepathsource = \Padosoft\Workbench\Parameters\Dir::adjustPath($source) . 'readme.md';
     $readmepathdestination = \Padosoft\Workbench\Parameters\Dir::adjustPath($destination) . 'index.html';
     $this->transformReadmeMd($readmepathsource, $readmepathdestination);
     //$gitWrapper = new GitWrapper();
     //$gitWorkingCopy=$gitWrapper->init($destination,[]);
     $gitSimpleWrapper = new GitSimpleWrapper($destination, null);
     $gitSimpleWrapper->git("init");
     $extension = $this->workbenchSettings->requested["git"]["valore"] == Parameters\Git::BITBUCKET ? "org" : "com";
     $gitSimpleWrapper->git("remote add origin https://" . $this->workbenchSettings->requested['user']['valore'] . ":" . $this->workbenchSettings->requested['password']['valore'] . "@" . $this->workbenchSettings->requested["git"]["valore"] . "." . $extension . "/" . $this->workbenchSettings->requested['organization']['valore'] . "/" . $this->workbenchSettings->requested['packagename']['valore'] . ".git");
     $gitSimpleWrapper->git("checkout -b gh-pages");
     $gitSimpleWrapper->git("add .");
     $gitSimpleWrapper->git("commit -m Workbench commit");
     $gitSimpleWrapper->git("push origin gh-pages");
 }
 /**
  *
  */
 public function apiSamiGeneration()
 {
     $source = \Padosoft\Workbench\Parameters\Dir::adjustPath($this->workbenchSettings->requested['dir']['valore'] . $this->workbenchSettings->requested['domain']['valore']);
     $sourceTmp = \Padosoft\Workbench\Parameters\Dir::adjustPath(sys_get_temp_dir()) . $this->workbenchSettings->requested['domain']['valore'];
     if (!File::copyDirectory($source, $sourceTmp)) {
         $this->command->line("Error copy project in " . $sourceTmp);
     }
     $this->command->line("Project copy in " . $sourceTmp);
     $destination = \Padosoft\Workbench\Parameters\Dir::adjustPath(Config::get('workbench.diraccess.' . $this->workbenchSettings->requested['dirtype']['valore'] . '.doc') . $this->workbenchSettings->requested['organization']['valore']) . $this->workbenchSettings->requested['domain']['valore'];
     $samistring = $this->phpBinary . ' ' . \Padosoft\Workbench\Parameters\Dir::adjustPath(Config::get('workbench.common_dev_lib_path')) . 'sami.phar update ' . $sourceTmp . '/sami_config.php';
     //$samistring = $this->phpBinary.' '.$this->pharSamiBinary.' update '.$sourceTmp.'/sami_config.php';
     echo $samistring;
     echo "\r\n";
     exec($samistring . " 2>&1", $output, $returned_val);
     $this->command->line($output);
     //echo __DIR__;
     File::copyDirectory(__DIR__ . '/resources/resources/', $destination . '/resources/');
     //todo cambia da dove prendi resources
     $readmepathsource = \Padosoft\Workbench\Parameters\Dir::adjustPath($sourceTmp) . 'readme.md';
     $readmepathdestination = \Padosoft\Workbench\Parameters\Dir::adjustPath($destination) . 'index.html';
     $this->transformReadmeMd($readmepathsource, $readmepathdestination);
     $gitSimpleWrapper = new GitSimpleWrapper($destination, null);
     $gitSimpleWrapper->git("init");
     $extension = $this->workbenchSettings->requested["git"]["valore"] == Parameters\Git::BITBUCKET ? "org" : "com";
     try {
         $gitSimpleWrapper->git("remote rm origin");
         $this->command->line("delete origin");
     } catch (\Exception $e) {
         $this->command->line("delete origin");
     }
     $gitSimpleWrapper->git("remote add origin https://" . $this->workbenchSettings->requested['user']['valore'] . ":" . $this->workbenchSettings->requested['password']['valore'] . "@" . $this->workbenchSettings->requested["git"]["valore"] . "." . $extension . "/" . $this->workbenchSettings->requested['organization']['valore'] . "/" . $this->workbenchSettings->requested['packagename']['valore'] . ".git");
     $this->command->line("gh-pages search");
     $output = "";
     try {
         $this->command->line("Destination is: " . $destination);
         $output = $gitSimpleWrapper->git("rev-parse --quiet --verify gh-pages");
     } catch (\Exception $e) {
         $output = "";
         //$gitWrapper->getDispatcher()
         //dd($e->getMessage() ."\r\n". $e->getTraceAsString());
     }
     $this->command->line("output is: " . implode("", $output));
     if (implode("", $output) == "") {
         $out = $gitSimpleWrapper->git("checkout -b gh-pages");
         $this->command->line("Create and checkout to gh-pages");
     }
     if (implode("", $output) != "") {
         $out = $gitSimpleWrapper->git("checkout gh-pages");
         $this->command->line("Checkout to gh-pages");
     }
     $this->command->line("Message for checkout: " . implode("", $out));
     try {
         if (file_exists($destination . "/.gitignore")) {
             unlink($destination . "/.gitignore");
         }