/**
  * @param \Lightwerk\SurfCaptain\Domain\Facet\Deployment\CopyDeployment $copyDeployment
  * @return void
  */
 public function createAction(CopyDeployment $copyDeployment)
 {
     try {
         $deployment = $this->deploymentFactory->createFromCopyDeployment($copyDeployment);
         $this->deploymentRepository->add($deployment);
         $this->addFlashMessage('Created a new copy 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 $presetKey 
  * @param string $type
  * @return void
  */
 public function createCopyDeploymentCommand($sourcePresetKey, $targetPresetKey)
 {
     $initSyncDeployment = new InitSyncDeployment();
     $initSyncDeployment->setSourcePresetKey($sourcePresetKey);
     $gitRepositoryDeployment = new GitRepositoryDeployment();
     $copyDeployment = new CopyDeployment();
     $copyDeployment->setPresetKey($targetPresetKey);
     $copyDeployment->setInitSyncDeployment($initSyncDeployment);
     $copyDeployment->setGitRepositoryDeployment($gitRepositoryDeployment);
     try {
         $deployment = $this->deploymentFactory->createFromCopyDeployment($copyDeployment);
         $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());
     }
 }