| Q | A
| ----------------- | ---
| Issue Type | Bug, Question
| Deployer Version | 6.0.5
| Local Machine OS | MAC
| Remote Machine OS | Debian (PHP 7.1)
I just want to set /image folder as shared directory, but I am getting following error:
In Client.php line 96:
[Deployer\Exception\RuntimeException (1)]
The command "ln -nfs --relative /var/www/deployments/project.com/shared/image/ /var/www/deployments/project.com/releases/1/image/" failed.
Exit Code: 1 (General error)
Host Name: project.com
================
ln: target '/var/www/deployments/project.com/releases/1/image/' is not a directory: No such file or directory
When I check the code of recipe/deploy/shared.php, shared directory is removed from source here and when creating the directory it is using parent directory of shared_dir here and here. It means, it is removing /var/www/deployments/project.com/releases/1/image/ and creating /var/www/deployments/project.com/releases/1/ which is already exists and root folder. So when it tries to link it fails.
I fixed this error by removing dirname from here and here.
PS: I was using deployer for my Laravel projects successfully with recipe/laravel.php, I don't understand how it was working so far...
It is a simple OpenCart installation. You can test it with a fresh OpenCart installation or any php project should produce this error.
deploy.phprequire 'recipe/common.php';
set('shared_files', ['image/']);
...
It is in Description.
Ok, I need to remove trailing slash from path 'image/' -> 'image'. Maybe a rtrim is needed here.
Most helpful comment
Ok, I need to remove trailing slash from path
'image/'->'image'. Maybe artrimis needed here.