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

[Question] what is the use of override_shared_dirs? #60

Closed hanhpv closed 4 years ago

hanhpv commented 4 years ago

There is not a documentation on this value. Can you please share the use cases of this variable? I'm not quite understand the idea of copying content of var/cache in release path to shared/var/cache Thank in advance.

PauloPhagula commented 4 years ago

TLDR: See https://github.com/jalogut/magento2-deployer-plus/pull/18/files

Long version:

The idea here is that the folders in override_shared_dirs are mostly cache folders that should be shared between servers in the same way as pub/media is, but not between deployments, i.e. each deployment should have its cache, but that cache should be shared between say server A and server B, such that if those servers are load balanced, if you hit A and a cache is generated for that request and then you hit B, the server should not need to handle the request fully and can simply use the cache instead.

Also, very importantly, because doing php bin/magento setup:di:compile fails if it finds a symlink instead of a folder in the paths listed in override_shared_dirs, the task deploy:override was created as to only run after magento setup:di:compile. This task goes and replaces the new "empty" caches in for example current/var/cache with say release<date>/var/cache