예제 #1
0
 /**
  * Registers a Grunt build task if the project Extension path was specified in the options.
  *
  * @param Workflow $workflow
  */
 protected function registerFrontendBuildTasks(Workflow $workflow)
 {
     if (!$this->hasOption('projectExtensionPath')) {
         return;
     }
     $projectExtensionPath = rtrim($this->getOption('projectExtensionPath'), '/');
     $workflow->defineTask('Intera\\Surf\\DefinedTask\\Grunt\\BuildTask', \Intera\Surf\Task\Grunt\BuildTask::class, ['forceLocalMode' => true, 'gruntRootPath' => $projectExtensionPath . '/Resources/Private/Build', 'skipMissingDirectory' => true]);
     $workflow->afterTask('TYPO3\\Surf\\DefinedTask\\Composer\\LocalInstallTask', 'Intera\\Surf\\DefinedTask\\Grunt\\BuildTask', $this);
 }
예제 #2
0
 /**
  * Configure tasks
  *
  * @param Workflow $workflow
  * @param Deployment $deployment
  * @return void
  */
 protected function defineTasks(Workflow $workflow, Deployment $deployment)
 {
     $excludePatterns = array('.git*', 'Data/*', 'Web/_Resources/*', 'Build/Reports', './Cache', 'Configuration/PackageStates.php');
     $baseArchiveConfiguration = array('sourceDirectory' => $deployment->getApplicationReleasePath($this), 'baseDirectory' => $this->configuration['versionAndProjectName'], 'exclude' => $excludePatterns);
     $workflow->defineTask('TYPO3\\Surf\\DefinedTask\\CreateZipDistributionTask', 'TYPO3\\Surf\\Task\\CreateArchiveTask', array_merge($baseArchiveConfiguration, array('targetFile' => $this->configuration['zipFile'])));
     $workflow->defineTask('TYPO3\\Surf\\DefinedTask\\CreateTarGzDistributionTask', 'TYPO3\\Surf\\Task\\CreateArchiveTask', array_merge($baseArchiveConfiguration, array('targetFile' => $this->configuration['tarGzFile'])));
     $workflow->defineTask('TYPO3\\Surf\\DefinedTask\\CreateTarBz2DistributionTask', 'TYPO3\\Surf\\Task\\CreateArchiveTask', array_merge($baseArchiveConfiguration, array('targetFile' => $this->configuration['tarBz2File'])));
     if ($this->hasOption('enableSourceforgeUpload') && $this->getOption('enableSourceforgeUpload') === true) {
         $workflow->defineTask('TYPO3\\Surf\\Task\\SourceforgeUploadTask', 'TYPO3\\Surf\\Task\\SourceforgeUploadTask', array('sourceforgeProjectName' => $this->getOption('sourceforgeProjectName'), 'sourceforgePackageName' => $this->getOption('sourceforgePackageName'), 'sourceforgeUserName' => $this->getOption('sourceforgeUserName'), 'version' => $this->getOption('version'), 'files' => array($this->configuration['zipFile'], $this->configuration['tarGzFile'], $this->configuration['tarBz2File'])));
     }
     if ($this->hasOption('releaseHost')) {
         $workflow->defineTask('TYPO3\\Surf\\Task\\Release\\PrepareReleaseTask', 'TYPO3\\Surf\\Task\\Release\\PrepareReleaseTask', array('releaseHost' => $this->getOption('releaseHost'), 'releaseHostSitePath' => $this->getOption('releaseHostSitePath'), 'releaseHostLogin' => $this->hasOption('releaseHostLogin') ? $this->getOption('releaseHostLogin') : null, 'productName' => $this->getOption('projectName'), 'version' => $this->getOption('version')));
         $workflow->defineTask('TYPO3\\Surf\\Task\\Release\\ReleaseTask', 'TYPO3\\Surf\\Task\\Release\\ReleaseTask', array('releaseHost' => $this->getOption('releaseHost'), 'releaseHostSitePath' => $this->getOption('releaseHostSitePath'), 'releaseHostLogin' => $this->hasOption('releaseHostLogin') ? $this->getOption('releaseHostLogin') : null, 'productName' => $this->getOption('projectName'), 'version' => $this->getOption('version'), 'changeLogUri' => $this->hasOption('changeLogUri') ? $this->getOption('changeLogUri') : null));
     }
     if ($this->hasOption('releaseHost') && $this->hasOption('enableSourceforgeUpload') && $this->getOption('enableSourceforgeUpload') === true) {
         $workflow->defineTask('TYPO3\\Surf\\Task\\Release\\AddDownloadTask', 'TYPO3\\Surf\\Task\\Release\\AddDownloadTask', array('releaseHost' => $this->getOption('releaseHost'), 'releaseHostSitePath' => $this->getOption('releaseHostSitePath'), 'releaseHostLogin' => $this->hasOption('releaseHostLogin') ? $this->getOption('releaseHostLogin') : null, 'productName' => $this->getOption('projectName'), 'version' => $this->getOption('version'), 'label' => $this->getOption('releaseDownloadLabel'), 'downloadUriPattern' => $this->getOption('releaseDownloadUriPattern'), 'files' => array($this->configuration['zipFile'], $this->configuration['tarGzFile'], $this->configuration['tarBz2File'])));
     }
     $workflow->defineTask('TYPO3\\Surf\\Task\\Git\\TagTask', 'TYPO3\\Surf\\Task\\Git\\TagTask', array('tagName' => $this->configuration['versionAndProjectName'], 'description' => 'Tag distribution with tag ' . $this->configuration['versionAndProjectName'], 'recurseIntoSubmodules' => $this->getOption('tagRecurseIntoSubmodules')));
     $workflow->defineTask('TYPO3\\Surf\\DefinedTask\\Git\\PushTagsTask', 'TYPO3\\Surf\\Task\\Git\\PushTask', array('remote' => 'origin', 'refspec' => $this->configuration['versionAndProjectName'] . ':refs/tags/' . $this->configuration['versionAndProjectName'], 'recurseIntoSubmodules' => $this->getOption('tagRecurseIntoSubmodules')));
 }
예제 #3
0
 /**
  * @param \TYPO3\Surf\Domain\Model\Workflow $workflow
  * @param string $packageMethod
  * @return void
  */
 protected function registerTasksForPackageMethod(Workflow $workflow, $packageMethod)
 {
     switch ($packageMethod) {
         case 'git':
             $workflow->addTask('TYPO3\\Surf\\Task\\Package\\GitTask', 'package', $this);
             $workflow->defineTask('TYPO3\\Surf\\DefinedTask\\Composer\\LocalInstallTask', 'TYPO3\\Surf\\Task\\Composer\\InstallTask', array('nodeName' => 'localhost', 'useApplicationWorkspace' => true));
             $workflow->afterTask('TYPO3\\Surf\\Task\\Package\\GitTask', 'TYPO3\\Surf\\DefinedTask\\Composer\\LocalInstallTask', $this);
             break;
     }
 }
예제 #4
0
 /**
  * @param Workflow $workflow
  * @param Deployment $deployment
  * @return void
  */
 protected function defineTasks(Workflow $workflow, Deployment $deployment)
 {
     foreach ($this->taskOptions as $task => $taskSettings) {
         if (empty($taskSettings['baseTask'])) {
             $taskSettings['baseTask'] = $task;
         }
         if ($taskSettings['baseTask'] !== $task && isset($this->taskOptions[$taskSettings['baseTask']])) {
             $taskSettings['baseTask'] = $this->getTaskNameForApplication($taskSettings['baseTask']);
         }
         if (!isset($taskSettings['options']) || !is_array($taskSettings['options'])) {
             $taskSettings['options'] = array();
         }
         $workflow->defineTask($this->getTaskNameForApplication($task), $taskSettings['baseTask'], $taskSettings['options']);
     }
 }