Skip to content

Instantly share code, notes, and snippets.

@sergiojovanig
Last active March 18, 2021 12:36
Show Gist options
  • Save sergiojovanig/dd0df2c3d345228975bbaff4e6f90116 to your computer and use it in GitHub Desktop.
Save sergiojovanig/dd0df2c3d345228975bbaff4e6f90116 to your computer and use it in GitHub Desktop.
Deploy Magento 2 steps
php bin/magento setup:backup --db
gzip var/backups/*.sql
git pull
php bin/magento maintenance:enable
php bin/magento cache:enable
rm -fr var/di var/generation var/cache
php bin/magento setup:di:compile
php bin/magento deploy:mode:set production --skip-compilation
php bin/magento maintenance:enable
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:db-schema:upgrade
php bin/magento setup:db-data:upgrade
php bin/magento setup:static-content:deploy
php bin/magento indexer:reindex
php bin/magento maintenance:disable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment