jalogut / magento2-deployer-plus

Tool based on deployer.org to perform zero downtime deployments of Magento 2 projects
GNU General Public License v3.0
200 stars 59 forks source link

Shared_dirs doesn't seem right #14

Closed superdav42 closed 6 years ago

superdav42 commented 6 years ago

In recipe/magento_2_1.php shared_dirs are set as:

set('shared_dirs', [
    '{{magento_dir}}/var',
    '{{magento_dir}}/pub/media',
    '{{magento_dir}}/pub/static/_cache',
]);

Seems like it the media folder should be the only shared dir. Commands like

bin/magento deploy:mode:set production
Enabling maintenance mode
Config "dev/debug/debug_logging = 0" has been saved.
Disabling maintenance mode
The directory "/srv/releases/20180628170504/pub/static/_cache" cannot be deleted Warning!rmdir(/srv/releases/20180628170504/pub/static/_cache): Not a directory

fail when pub/static/_cache is a symlink and I see no advantage to making it a shared dir.

Also I would think /var shouldn't be a shared dir as any cache clearing or setting in one release would affect all the others causing all possible problems with version mismatches.

jalogut commented 6 years ago

Hi @superdav42 yes you are right. I am aware of that but I did not fix it yet. Var should not be shared but some folders inside need it. I am gonna add a fix next week for that.

Regarding the _cache why are you executing deploy:mode:set production? That should not be needed. The reason why this folder is shared is here:

jalogut commented 6 years ago

@superdav42 fix has been added in version 2.0, please let me know if you still have issues

jalogut commented 6 years ago

I managed to reproduce this issue and add a PR that fixes it. It should be available soon.

jalogut commented 6 years ago

Fixed in version 2.1