/** * @param Deployment $deployment * @return void */ public function updateAction(Deployment $deployment) { // ToDo: Just status can be changed to canceled if it was waiting before! $this->deploymentRepository->update($deployment); $this->addFlashMessage('Updated a deployment.'); $this->redirect('index'); }
/** * @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 \Lightwerk\SurfCaptain\Domain\Facet\Deployment\InitSyncDeployment $initSyncDeployment * @return void */ public function createAction(InitSyncDeployment $initSyncDeployment) { try { $deployment = $this->deploymentFactory->createFromInitSyncDeployment($initSyncDeployment); $this->deploymentRepository->add($deployment); $this->addFlashMessage('Created a new init shared deployment.', 'OK', Message::SEVERITY_OK); } catch (\Lightwerk\SurfCaptain\Exception $e) { $this->handleException($e); } catch (\TYPO3\Flow\Http\Exception $e) { $this->handleException($e); } $this->redirect('index', 'Deployment'); }
/** * @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); } }
/** * @param string $presetKey * @param string $type * @return void */ public function createInitSyncDeploymentCommand($sourcePresetKey, $targetPresetKey) { $initSyncDeployment = new InitSyncDeployment(); $initSyncDeployment->setSourcePresetKey($sourcePresetKey); $initSyncDeployment->setPresetKey($targetPresetKey); try { $deployment = $this->deploymentFactory->createFromInitSyncDeployment($initSyncDeployment); $this->deploymentRepository->add($deployment); $this->outputLine('OK: deployment added'); } catch (\Lightwerk\SurfCaptain\Exception $e) { $this->outputLine('ERROR: ' . $e->getMessage() . ' - ' . $e->getCode()); } catch (\TYPO3\Flow\Http\Exception $e) { $this->outputLine('ERROR: ' . $e->getMessage() . ' - ' . $e->getCode()); } }
/** * @param SurfCaptainDeployment $surfCaptainDeployment * @return void * @throws \TYPO3\Flow\Persistence\Exception\IllegalObjectTypeException */ protected function writeSurfCaptainDeployment(SurfCaptainDeployment $surfCaptainDeployment) { $this->deploymentRepository->update($surfCaptainDeployment); $this->persistenceManager->persistAll(); }