/**
  * Show Command
  *
  * @param string $url
  * @return void
  */
 public function showCommand($url = 'git@github.com:achimfritz/championship-distribution.git')
 {
     $repository = $this->driverComposite->getRepository($url);
     $this->outputLine('repositoryUrl: ' . $repository->getRepositoryUrl());
     $this->outputLine('name: ' . $repository->getName());
     $this->outputLine('webUrl: ' . $repository->getWebUrl());
     $this->outputLine('branches');
     $branches = $repository->getBranches();
     if (count($branches) === 0) {
         $this->outputLine('no branches found');
     } else {
         foreach ($branches as $branch) {
             $commit = $branch->getCommit();
             $this->outputLine($branch->getName() . ' ' . $commit->getId() . ' ' . $commit->getMessage() . ' ' . $commit->getCommitterName() . ' ' . $commit->getDate());
         }
     }
     $this->outputLine('tags');
     $tags = $repository->getTags();
     if (count($tags) === 0) {
         $this->outputLine('no tags found');
     } else {
         foreach ($tags as $tag) {
             $commit = $tag->getCommit();
             $this->outputLine($tag->getName() . ' ' . $commit->getId() . ' ' . $commit->getMessage() . ' ' . $commit->getCommitterName() . ' ' . $commit->getDate());
         }
     }
 }
 /**
  * @param string $repositoryUrl
  * @return void
  */
 public function showAction($repositoryUrl)
 {
     try {
         $repository = $this->driverComposite->getRepository($repositoryUrl)->setDeployments($this->deploymentRepository->findByRepositoryUrl($repositoryUrl))->setPresets($this->presetRepository->findByRepositoryUrl($repositoryUrl));
         $this->view->assign('repository', $repository);
     } catch (\Lightwerk\SurfCaptain\Service\Exception $e) {
         $this->handleException($e);
     } catch (\Lightwerk\SurfCaptain\GitApi\Exception $e) {
         $this->handleException($e);
     } catch (\TYPO3\Flow\Http\Exception $e) {
         $this->handleException($e);
     }
 }
Exemplo n.º 3
0
 /**
  * @param array
  * @return \Lightwerk\SurfCaptain\Domain\Model\Deployment
  */
 protected function createFromConfiguration($configuration)
 {
     $repositoryUrl = $configuration['applications'][0]['options']['repositoryUrl'];
     $repository = $this->driverComposite->getRepository($repositoryUrl);
     $deployment = new Deployment();
     $deployment->setRepositoryIdentifier($repository->getIdentifier());
     $deployment->setRepositoryUrl($repositoryUrl);
     $deployment->setStaticConfiguration($configuration);
     // throw the clientIp away?
     $deployment->setClientIp('');
     return $deployment;
 }
Exemplo n.º 4
0
 /**
  * @return Repository|NULL
  */
 public function getRepository()
 {
     // ToDo lw-lm: Find better way to do that (Flow/Inject annotation?)
     // TODO refactor $this->repository, $this->configuration and $this->getOptions()
     if ($this->repository === NULL) {
         $repositoryUrl = $this->getRepositoryUrl();
         if (!empty($repositoryUrl)) {
             try {
                 $this->repository = $this->driverComposite->getRepository($repositoryUrl);
             } catch (\Exception $e) {
                 $this->repository = FALSE;
             }
         }
     }
     return $this->repository ?: NULL;
 }