Is there any way to run one file and fire multiple magento2 command like Index, static content, deploy, cache clear etc. And for all files permissions set Automatically.
1 Answer
If you are using a Linux system, then you can create commands.sh file and put all this code.
rm -rf var/cache/ var/page_cache/ var/view_preprocessed/ pub/static/frontend/ pub/static/adminhtml/
php -dmemory_limit=8G bin/magento cache:clean
php -dmemory_limit=8G bin/magento cache:flush
php -dmemory_limit=8G bin/magento catalog:images:resize
php -dmemory_limit=8G bin/magento setup:upgrade
php -dmemory_limit=8G bin/magento setup:di:compile
php -dmemory_limit=8G bin/magento indexer:reset
php -dmemory_limit=8G bin/magento indexer:reindex
php -dmemory_limit=8G bin/magento setup:static-content:deploy -f
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
find ./var -type d -exec chmod 777 {} \;
find ./pub/media -type d -exec chmod 777 {} \;
find ./pub/static -type d -exec chmod 777 {} \;
chmod 777 ./app/etc
chmod 644 ./app/etc/*.xml
-
i wonder if someone already copied this an run on his setup...– MagenXCommented May 19, 2019 at 9:36
-
I run some of the above commands on my local system. you can suggest your review if I wrote the wrong answer. Commented May 19, 2019 at 12:18