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

Loss of the contents of folders var and pub #26

Closed demidov-i-a closed 6 years ago

demidov-i-a commented 6 years ago

When switching to a new release occurs, the contents of folders var and pub are lost with the exception of these shared folders

set ('shared_dirs', [ '{{magento_dir}}/pub/media', '{{magento_dir}}/var/log', '{{magento_dir}}/var/backups', '{{magento_dir}}/var/session', ]);

The problem is that many modules save files directly to the root of folders var and pub.

For example, pub/google_sitemap_3_1008.xml

Do I understand correctly that this is the right behavior and can this problem be solved in some way?

osrecio commented 6 years ago

Yes, you can solve the problem overriding shared_dirs in your deploy.php For example:

set ('shared_dirs', [
'{{magento_dir}}/pub/media',
'{{magento_dir}}/var/log',
'{{magento_dir}}/var/backups',
'{{magento_dir}}/var/session',
'{{magento_dir}}/pub/sitemaps',
]);

In your Magento you should add your sitemaps inside of your folder: sitemaps

And you shoul hace access to your sitempas like: https://domain.com/sitemaps/google_sitemap_3_1008.xml And specify in Google Search console this route.

You can add also '{{magento_dir}}/var' if you need share all content of folder var

demidov-i-a commented 6 years ago

Thanks for the help!