/** * @param Deployment $deployment * @return void */ public function createAction(Deployment $deployment) { $deployment->setClientIp($this->request->getHttpRequest()->getClientIpAddress()); $this->deploymentRepository->add($deployment); $this->addFlashMessage('Created a new deployment.'); $this->redirect('index', NULL, NULL, array('deployment' => $deployment)); }
/** * @param string $key * @throws \TYPO3\Flow\Persistence\Exception\IllegalObjectTypeException * @return void */ public function createAction($key) { $configuration = $this->presetRepository->findByIdentifier($key); $deployment = new Deployment(); $deployment->setConfiguration($configuration); $deployment->setClientIp($this->request->getHttpRequest()->getClientIpAddress()); $this->deploymentRepository->add($deployment); $this->addFlashMessage('Created a new deployment.'); $this->redirect('index', NULL, NULL, array('deployment' => $deployment)); }
/** * @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; }
/** * @param string $key * @param string $type * @param string $context * @param string $branch * @return void */ public function createCommand($key, $type = 'TYPO3\\CMS\\Deploy', $context = 'Development', $branch = 'master') { $deployment = new Deployment(); $deployment->setClientIp('127.0.0.1'); try { $preset = $this->presetRepository->findByIdentifier($key); } catch (\Lightwerk\Surfcaptain\Exception $e) { $this->outputLine('cannot get preset'); $this->quit(); } $preset['applications'][0]['options']['branch'] = $branch; $preset['applications'][0]['options']['context'] = $context; $preset['applications'][0]['type'] = $type; if ($deployment->getRepository() !== NULL) { $this->deploymentRepository->add($deployment); $this->outputLine('SUCCESS: deployment created'); } else { $this->outputLine('ERROR: no repository'); } }