zeloc
8/16/2018 - 8:21 AM

clean all with static content deploy and di compile

clean all with static content deploy and di compile

#!/usr/bin/env bash
cd /var/www/vhosts/partyshowroom/production/htdocs/
echo 'Clearing magento cache...'
rm -rf /var/www/vhosts/partyshowroom/production/htdocs/var/cache/*
echo 'Clearing page cache...'
rm -rf /var/www/vhosts/partyshowroom/production/htdocs/var/page_cache/*
echo 'Restarting Varnish service'
sudo /etc/init.d/varnish restart
echo 'Clear generation files...'
rm -rf /var/www/vhosts/partyshowroom/production/htdocs/var/generation/*
echo 'Clear view preprocessed...'
rm -rf /var/www/vhosts/partyshowroom/production/htdocs/var/view_preprocessed/*
echo 'Clear Static files...'
rm -rf /var/www/vhosts/partyshowroom/production/htdocs/pub/static/*
echo 'Running setup upgrade'
php /var/www/vhosts/partyshowroom/production/htdocs/bin/magento setup:upgrade
echo 'Running di compile'
php /var/www/vhosts/partyshowroom/production/htdocs/bin/magento setup:di:compile
echo 'Running static content deploy'
php /var/www/vhosts/partyshowroom/production/htdocs/bin/magento setup:static-content:deploy en_US en_GB

echo 'Clean complete'