public function performTask()
 {
     try {
         $this->getContainer()->setState(Container::STATE_PROVISIONING);
         parent::performTask();
     } catch (RainmakerException $e) {
         throw $e;
     }
 }
Exemplo n.º 2
0
 public function performTask()
 {
     try {
         $this->getContainer()->setState(Container::STATE_PROVISIONING);
         $this->getEntityManager()->getRepository('Rainmaker:Container')->saveContainer($this->getContainer());
         parent::performTask();
         $this->getContainer()->setState(Container::STATE_STOPPED);
         $this->getEntityManager()->getRepository('Rainmaker:Container')->saveContainer($this->getContainer());
     } catch (RainmakerException $e) {
         throw $e;
     }
 }
Exemplo n.º 3
0
 public function performTask()
 {
     try {
         $this->getContainer()->setState(Container::STATE_PROVISIONING);
         $this->getEntityManager()->getRepository('Rainmaker:Container')->saveContainer($this->getContainer());
         parent::performTask();
         if (!empty($this->branchContainer)) {
             $projectBranchTask = new \Rainmaker\Task\Subtask\CreateProjectBranch();
             $this->prepareSubtask($projectBranchTask);
             $projectBranchTask->setContainer($this->branchContainer)->setStartContainerAfterBuild($this->getStartBranchContainerAfterBuild())->performTask();
         }
     } catch (RainmakerException $e) {
         throw $e;
     }
 }
Exemplo n.º 4
0
 public function performTask()
 {
     if ($this->getContainer()->isRunning()) {
         throw new RainmakerException('The container is running. It must be stopped before it can be destroyed.');
     }
     if (count($this->getEntityManager()->getRepository('Rainmaker:Container')->getProjectBranchContainers($this->getContainer())) > 0) {
         throw new RainmakerException('The container cannot be desroyed while it still has subcontainers configured.');
     }
     $this->log(\Monolog\Logger::DEBUG, 'Destroying container [' . $this->getContainer()->getName() . ']');
     try {
         $this->getContainer()->setState(Container::STATE_DESTROYING);
         $this->getEntityManager()->getRepository('Rainmaker:Container')->saveContainer($this->getContainer());
         parent::performTask();
     } catch (RainmakerException $e) {
         throw $e;
     }
     $this->getEntityManager()->getRepository('Rainmaker:Container')->removeContainer($this->getContainer());
 }
Exemplo n.º 5
0
 public function performTask()
 {
     $project = $this->getEntityManager()->getRepository('Rainmaker:Container')->getParentContainer($this->getContainer());
     if (!$project->isRunning()) {
         throw new RainmakerException('The project container is not running. It must be running before the project branch can be destroyed.');
     }
     if ($this->getContainer()->isRunning()) {
         throw new RainmakerException('The container is running. It must be stopped before it can be destroyed.');
     }
     $this->log(\Monolog\Logger::DEBUG, 'Destroying container [' . $this->getContainer()->getName() . ']');
     try {
         $this->getContainer()->setState(Container::STATE_DESTROYING);
         $this->getEntityManager()->getRepository('Rainmaker:Container')->saveContainer($this->getContainer());
         parent::performTask();
     } catch (RainmakerException $e) {
         throw $e;
     }
     $this->getEntityManager()->getRepository('Rainmaker:Container')->removeContainer($this->getContainer());
 }