Bit of a wierd one this and haven't got the bottom of it yet, nor have I seen it before. So I'm setting up the prod server of a new store and when deploying to the server, the first time bin/magento
is run, even without any arguments, just bin/magento
on it's own, everything under generated/code
and generated/metadata
gets deleted. Worth noting that with all further runs of bin/magento
the files aren't deleted. I'm using deployer.org to deploy which isn't relevant apart from that it makes releases for each deployment so I believe that as far as Magento is concerned when bin/magento
is run after a simple git clone
and then composer install
it's the first time the command has been run. The config in env.php
sets the mode to production
Can anyone shed any light on what is going on exactly? I have deployed plenty with a closely equivalent method for other stores and never come across this oddity. I also can't seem to find any examples of tickets, threads etc of others having this same issue.