#!/bin/sh
php bin/magento maintenance:enable;
echo "Removing generated files. Might take awhile. Please wait patiently..."
rm -rf generated/code/Magento/
rm -rf var/view_preprocessed/* var/cache/* var/page_cache/* var/generation/* pub/static/* generated/code/

# Include the flags to clear the cache on other stores
php bin/magento cache:flush
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
# /opt/bitnami/php/bin/php /opt/bitnami/apps/magento/htdocs/bin/magento indexer:reindex
echo "Changing file permissions. Will take awhile. Please wait patiently..."
php bin/magento maintenance:disable;
