Repository navigation
Confusion when using a configuration file in a different directory #4264
Deployer Versionv8.0.5 Target OSMacOS 14.8.9 Which PHP version are you using?PHP 8.5 Content of deploy.php or deploy.yamlSteps to reproduceWhen running the following command...
Deployer creates two deployment directories and does not use either one consistently. Note: the Magento 2 recipe is used. The intent is to test the deployment locally.
Output:
|
Replies: 2 comments
|
The problem is the relative paths. Most deploy tasks start with
Use absolute paths and build For |
|
Thanks! An absolute path did indeed fix the issue. Behavior becomes the same regardless of where the configuration file is located. I'll note that an absolute path does not meet my requirements. I'm attempting to create a configuration that would test the deployment locally across a team of people with different operating systems. Can't guarantee any absolute path would be present on multiple local systems. Only guarantee is what's checked out of the repository that the configuration file is in. But, I suppose compatibility with relative paths is a messy business :P |

The problem is the relative paths.
deploy_path: "testdeploy"andcurrent_path: "public_html"get resolved against whatever directory the command happens to be running in, and that changes during the deploy.Most deploy tasks start with
cd('{{deploy_path}}'). You can see it break indeploy:release: it has already cd'ed intotestdeploy, and then runstestdeploy/releaserelative totestdeploy/istestdeploy/testdeploy/release, which doesn't exist, henceln: testdeploy/release: No such file or directory. Tasks that don't cd first resolve the same values from the project root instead, so one setting points at two different places depending on the task.