Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Magento2 INIT script
MAG=magento #system wide symlink
# or absolute:
#MAG=/usr/share/nginx/mymagentoprojectroot/bin/magento #absolute path
echo "Enabling all modules with clearing static content..."
$MAG module:enable --all --clear-static-content
echo "Running setup upgrade..."
$MAG setup:upgrade
echo "Running code compiler (to avoid real time configuration and code analysis)..."
$MAG setup:di:compile
echo "Running static content deployment..."
$MAG setup:static-content:deploy
echo "Performing re-index of catalog database data..."
$MAG indexer:reindex
echo "Cleaning cache to apply all settings..."
$MAG cache:clean
$MAG cache:flush
echo "EOF"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.