Surf icon indicating copy to clipboard operation
Surf copied to clipboard

Document Deployment::relativeRootPaths

Open jonaseberle opened this issue 4 years ago • 3 comments

Expected Behavior

The documentation should have Deployment::relativeRootPaths which was added for v2.0+ in https://github.com/TYPO3/Surf/commit/f4d4f51b5a42b3a9631b2ba3b91c5949c306b81e

jonaseberle avatar Mar 05 '21 09:03 jonaseberle

Sorry for the long stale time on this issue. I am trying that on a project now for the first time. The project has a src folder which contains the default TYPO3 structure with composer.json etc.

I am using this config:

$application = new \TYPO3\Surf\Application\TYPO3\CMS();
$application
    ->setOption('webDirectory', 'public')
    ->setOption('symlinkDataFolders', ['fileadmin'])
    ...
$deployment
    ->setRelativeProjectRootPath('src')

This config will cause SymlinkDataTask to

cd '<deploymentPath>/releases/20210621112250/src' \
 && mkdir -p '../../shared/Data/fileadmin' \
 && ln -sf '../../../shared/Data/fileadmin' '<deploymentPath>/releases/20210621112250/src/public/fileadmin'

thus creating this structure

.
├── releases
│   ├── 20210621112250
│   │   └── src
│   │         └── public
│   │                └── fileadmin -> ../../../shared/Data/fileadmin
│   └── shared
│          └── Data
│                └── fileadmin
└── shared     [empty]

Also the WebOpcacheResetCreateScriptTask does not respect the relativeProjectRootPath yet and needs this config:

$deployment
    ->setTaskOptions(
        'TYPO3\Surf\Task\Php\WebOpcacheResetCreateScriptTask',
        [
            'scriptBasePath' => \TYPO3\Flow\Utility\Files::concatenatePaths(
                [
                    $deployment->getWorkspacePath($application),
                    $deployment->getRelativeProjectRootPath(),
                    $application->getOption('webDirectory'),
                ]
            ),
        ]
    )

I am not sure where to fix that. My understanding would be that local paths need getRelativeProjectRootPath() while transfer tasks should just transfer the contents of getRelativeProjectRootPath() thus remote tasks would not need to care for it.

jonaseberle avatar Jun 21 '21 11:06 jonaseberle

I have moved away from setRelativeProjectRootPath for multiple reasons.

As this seems pretty stale the feature could maybe be deprecated?

jonaseberle avatar Oct 06 '21 11:10 jonaseberle

I actually have such a weird system myself and here it works (not a TYPO3 project) but yes, it's not recommended.

simonschaufi avatar Oct 06 '21 11:10 simonschaufi