I have an img directory in storage/app/public that's not getting deployed and I can't for the life of me figure out why.
The directory exists in my git repo and is under version control, but when I deploy with Envoyer, the storage directory is incomplete, missing the app/public/img directory.
I've deleted all files and directories in my domain directory so that it's completely bare save the .env file and redeployed from scratch several times, but nothing.
Does anyone have any ideas as to why this isn't getting deployed?
Well the folder isn't being ignored now, it exists in the repo with all the images inside. So this has to be something related to how Envoyer deploys the repo.
I'm thinking maybe there's a script that creates the storage directories on first deploy, since they aren't actually stored within the releases and are simply simlinked from current to the correct release?
Can you check whether a git clone url-to-repo.git downloads the img folder when you do this locally? Obvs test this in another directory if the repo already exists locally
Managing Uploaded Files
When storing user uploaded files, you should store them in the storage directory of your application if you are using Laravel. Then, you may use the "Manage Linked Folders" feature of Envoyer to create a symbolic link from your public directory to the storage directory. The "Manage Linked Folders" button can be found on the "Deployment Hooks" tab of your project.
If you are not using Laravel, you will essentially follow the same process. However, you will need to manually create a storage directory in the deployment path of your application (the same directory level as the current symbolic link).
So essentially it has symbolic links and you may need to add the img folder using Manage Linked Folders.
Envoyer doesn't clone the repo, it downloads a tarball then untars it into the directory. But downloading the master from the github ui does include the directory in question so I can only assume the tarball would as well.
As for the Manage Linked Folders, I can give that a try I guess, though I'm currently running that process as a hook in Deployment Hooks:
cd {{release}}
php artisan storage:link
So the symlink already is created but I'll give this a shot and see if it does anything.
Yeah this does nothing other than create the symlink. I deleted all my files again and redeployed from scratch with the Manage Linked Folders set up and I still don't get the img directory deployed.
Very strange. I don't think the repo version of the storage directory is ever actually deployed, I think it's created by Envoyer.
Yeah I just went ahead and installed an FTP server and uploaded them that way. I've upgraded to using Laravel Mix, but that's definitely an option, maybe mix them down to the storage directory from resources ...
This works for now.
Thanks a lot for all your input. I appreciate your time =)
Hello Time Travellers! I came here today and in my grain of salt is that thou should try to edit the symlink to make it point to the new directory, it must be pointing to where it was before deployment.