I am looking for a sounding a board to make sure I am not "too far off base" on this issue.
Moving to Laravel soon and have taken on the daunting task of "wrapping" our Legacy Code in Laravel. I am currently converting our "storage" calls over to the Laravel storage pattern (storage/app, storage/framework, storage/logs, etc, etc).
The issue is actually two fold. The first issue is that everything in storage is git ignored, as it should be ... but the reality is that a lot of our files are assets that have intrinsic value. So they really should not be stored inside the "vhost" that contains the framework imo.
The second issue is that deployment is not done through changing conf files, or doing fresh repo pulls, but rather though symlinking the document root. ie:
document_root = /var/www/vhosts/site1/production/public
Where the "production" directory is symlinked to a repo directory:
/var/www/vhosts/site1/release-2.30
/var/www/vhosts/site1/release-2.29
/var/www/vhosts/site1/hotfix-1.45
Release process is: Create a directory (release-2.31), checkout the branch, run composer (in the future), point a stage conf file to the newly created directory and test. After testing, simply re-link the "production" directory to the newly created (and tested) repo branch ... in this case: release-2.31.
Still with me?
So the problem is that "storage" really can't / should not be in the actual branch. Yes, we could symlink the storage directory inside the repo directory to a storage directory outside of the repo branch, but that makes creating the branch directories require yet one more step, and then that grows to two more steps, and then 4 more steps ... not good.
My knee jerk reaction is to have permanent storage directories that relate to production vs stage. Then simply "register" the directories inside the .env files.
Directory would be something like:
/var/www/vhosts/storage/production/site1
/var/www/vhosts/storage/stage/site1
Where the env files have:
prod.env contains: putenv("PATH_STORAGE='/var/www/vhosts/storage/production/site1'");
I am not entirely happy with this solutions. I think the storage might be a bit too removed from the vhost it's associated with.
I am wondering if other people have had this dilemma and how they have solved it.
Thanks in advance.