public function registerTasks(Workflow $workflow, Deployment $deployment)
    {
        $this->setOption(GenericCreateDirectoriesTask::class . '[directories]', $this->getDirectories());
        $this->setOption(CreateSymlinksTask::class . '[symlinks]', $this->getSymlinks());

        if ($this->hasOption('packageMethod')) {
            $this->registerTasksForPackageMethod($workflow, $this->getOption('packageMethod'));
        }

        if ($this->hasOption('transferMethod')) {
            $this->registerTasksForTransferMethod($workflow, $this->getOption('transferMethod'));
        }

        $workflow->afterStage('transfer', CreateSymlinksTask::class, $this);

        if ($this->hasOption('updateMethod')) {
            $this->registerTasksForUpdateMethod($workflow, $this->getOption('updateMethod'));
        }

        // TODO Define tasks for local shell task and local git checkout

        $workflow
            ->addTask(CreateDirectoriesTask::class, 'initialize', $this)
            ->afterTask(CreateDirectoriesTask::class, GenericCreateDirectoriesTask::class, $this)
            ->addTask(SymlinkReleaseTask::class, 'switch', $this)
            ->addTask(CleanupReleasesTask::class, 'cleanup', $this);

        if ($this->hasOption('lockDeployment') && $this->getOption('lockDeployment') === true) {
            $workflow->addTask(LockDeploymentTask::class, 'lock', $this);
            $workflow->addTask(UnlockDeploymentTask::class, 'unlock', $this);
        }

        if ($deployment->getForceRun()) {
            $workflow->beforeTask(LockDeploymentTask::class, UnlockDeploymentTask::class, $this);
        }
    }
public function registerTasks(Workflow $workflow, Deployment $deployment)
    {
        $this->setOption(GenericCreateDirectoriesTask::class . '[directories]', $this->getDirectories());
        $this->setOption(CreateSymlinksTask::class . '[symlinks]', $this->getSymlinks());

        if ($this->hasOption('packageMethod')) {
            $this->registerTasksForPackageMethod($workflow, $this->getOption('packageMethod'));
        }

        if ($this->hasOption('transferMethod')) {
            $this->registerTasksForTransferMethod($workflow, $this->getOption('transferMethod'));
        }

        $workflow->afterStage('transfer', CreateSymlinksTask::class, $this);

        if ($this->hasOption('updateMethod')) {
            $this->registerTasksForUpdateMethod($workflow, $this->getOption('updateMethod'));
        }

        // TODO Define tasks for local shell task and local git checkout

        $workflow
            ->addTask(CreateDirectoriesTask::class, 'initialize', $this)
            ->afterTask(CreateDirectoriesTask::class, GenericCreateDirectoriesTask::class, $this)
            ->addTask(SymlinkReleaseTask::class, 'switch', $this)
            ->addTask(CleanupReleasesTask::class, 'cleanup', $this);

        if ($this->hasOption('lockDeployment') && $this->getOption('lockDeployment') === true) {
            $workflow->addTask(LockDeploymentTask::class, 'lock', $this);
            $workflow->addTask(UnlockDeploymentTask::class, 'unlock', $this);
        }

        if ($deployment->getForceRun()) {
            $workflow->beforeTask(LockDeploymentTask::class, UnlockDeploymentTask::class, $this);
        }
    }
public function registerTasks ( Workflow $ workflow , Deployment $ deployment ) { $ this -> setOption ( GenericCreateDirectoriesTask :: class . '[directories]' , $ this -> getDirectories ( ) ) ; $ this -> setOption ( CreateSymlinksTask :: class . '[symlinks]' , $ this -> getSymlinks ( ) ) ; if ( $ this -> hasOption ( 'packageMethod' ) ) { $ this -> registerTasksForPackageMethod ( $ workflow , $ this -> getOption ( 'packageMethod' ) ) ; } if ( $ this -> hasOption ( 'transferMethod' ) ) { $ this -> registerTasksForTransferMethod ( $ workflow , $ this -> getOption ( 'transferMethod' ) ) ; } $ workflow -> afterStage ( 'transfer' , CreateSymlinksTask :: class , $ this ) ; if ( $ this -> hasOption ( 'updateMethod' ) ) { $ this -> registerTasksForUpdateMethod ( $ workflow , $ this -> getOption ( 'updateMethod' ) ) ; } // TODO Define tasks for local shell task and local git checkout $ workflow -> addTask ( CreateDirectoriesTask :: class , 'initialize' , $ this ) -> afterTask ( CreateDirectoriesTask :: class , GenericCreateDirectoriesTask :: class , $ this ) -> addTask ( SymlinkReleaseTask :: class , 'switch' , $ this ) -> addTask ( CleanupReleasesTask :: class , 'cleanup' , $ this ) ; if ( $ this -> hasOption ( 'lockDeployment' ) && $ this -> getOption ( 'lockDeployment' ) === true ) { $ workflow -> addTask ( LockDeploymentTask :: class , 'lock' , $ this ) ; $ workflow -> addTask ( UnlockDeploymentTask :: class , 'unlock' , $ this ) ; } if ( $ deployment -> getForceRun ( ) ) { $ workflow -> beforeTask ( LockDeploymentTask :: class , UnlockDeploymentTask :: class , $ this ) ; } }
Register tasks for the base application

The base application performs the following tasks:

Initialize stage:
- Create directories for release structure

Update stage:
- Perform Git checkout (and pass on sha1 / tag or branch option from application to the task)

Switch stage:
- Symlink the current and previous release

Cleanup stage:
- Clean up old releases

@param \TYPO3\Surf\Domain\Model\Workflow $workflow
@param \TYPO3\Surf\Domain\Model\Deployment $deployment
Register tasks for the base application