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);
        }
    }