Skip to content

Instantly share code, notes, and snippets.

@stamster
Created May 7, 2016 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stamster/21c9c518f2fd6ac3521b5d671db58449 to your computer and use it in GitHub Desktop.
Save stamster/21c9c518f2fd6ac3521b5d671db58449 to your computer and use it in GitHub Desktop.
Magento2 INIT script
#!/bin/bash
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 "ALL OPERATIONS COMPLETE."
echo "EOF"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment