Recently, we have gone live a website which was built in Magento 2.3.1. After release we did some changes in the code and also added some modules locally. Then the code was pushed to the live server and executed the following commands on the terminal :
- sudo git stash
- sudo git stash clear
- git checkout development
- git pull origin development
- sudo php bin/magento maintenance:enable
- touch maintenance.enable
- sudo chmod -R 777 var/ generated
- sudo rm -rf var/ generated
- sudo php bin/magento cache:flush
- sudo php bin/magento setup:upgrade
- sudo php bin/magento setup:di:compile
- sudo php bin/magento setup:static-content:deploy
- sudo chmod -R 777 var/ generated/ app/ pub/
- sudo rm -rf maintenance.enable
- sudo php bin/magento maintenance:disable
- sudo rm -rf maintenance.html
- sudo chmod -R 777 var/ generated/ app/ pub/
After one hour, there were issues in placing the order, adding subscriptions etc. On analysis we find that there were no permission for the var folder. we gave the permission and all issues were fixed.
I dont know why this happened as we already gave the permission after the deployment commands.
Can someone help me resolve this or tell me the CORRECT steps to be followed in a production server which deploying new changes???