/**
  * Executes this task
  *
  * @param \TYPO3\Deploy\Domain\Model\Node $node
  * @param \TYPO3\Deploy\Domain\Model\Application $application
  * @param \TYPO3\Deploy\Domain\Model\Deployment $deployment
  * @param array $options
  * @return void
  */
 public function execute(Node $node, Application $application, Deployment $deployment, array $options = array())
 {
     $deploymentPath = $application->getDeploymentPath();
     $sharedPath = $application->getSharedPath();
     $result = $this->shell->execute('test -d ' . $deploymentPath, $node, $deployment, TRUE);
     if ($result === FALSE) {
         throw new \Exception('Deployment directory "' . $deploymentPath . '" does not exist on ' . $node->getName(), 1311003253);
     }
     $this->shell->executeOrSimulate('mkdir -p ' . $deploymentPath . '/releases;mkdir -p ' . $sharedPath, $node, $deployment);
 }
Example #2
0
 /**
  * Rollback this task
  *
  * @param \TYPO3\Deploy\Domain\Model\Node $node
  * @param \TYPO3\Deploy\Domain\Model\Application $application
  * @param \TYPO3\Deploy\Domain\Model\Deployment $deployment
  * @param array $options
  * @return void
  */
 public function rollback(Node $node, Application $application, Deployment $deployment, array $options = array())
 {
     $deploymentPath = $application->getDeploymentPath();
     $sharedPath = $application->getSharedPath();
     $releasePath = $deployment->getApplicationReleasePath($application);
     $currentPath = $application->getDeploymentPath() . '/releases/current';
     $previousPath = $application->getDeploymentPath() . '/releases/previous';
     if (!isset($options['rollbackCommand'])) {
         return;
     }
     $command = $options['rollbackCommand'];
     $command = str_replace(array('{deploymentPath}', '{sharedPath}', '{releasePath}', '{currentPath}', '{previousPath}'), array($deploymentPath, $sharedPath, $releasePath, $currentPath, $previousPath), $command);
     $this->shell->execute($command, $node, $deployment, TRUE);
 }