| 123456789101112131415161718192021222324252627282930 |
- #!/bin/bash
- # Script to initialize a Magento development environment
- # Exit immediately if a command fails
- set -e
- echo ">>> Deploying Magento sample data..."
- bin/magento sampledata:deploy
- echo ">>> Disabling Two-Factor Authentication (for dev only)..."
- bin/composer require --dev markshust/magento2-module-disabletwofactorauth
- bin/magento module:enable MarkShust_DisableTwoFactorAuth
- echo ">>> Running setup upgrade (applies sample data + new modules)..."
- bin/magento setup:upgrade
- echo ">>> Setting long admin session lifetime (1 year)..."
- bin/magento config:set twofactorauth/general/enable 0
- bin/magento config:set admin/security/session_lifetime 31536000
- echo ">>> Generating URN catalog for IDEs..."
- bin/dev-urn-catalog-generate
- echo ">>> Running final optimizations (compile, reindex, cache flush)..."
- bin/magento setup:di:compile
- bin/magento indexer:reindex
- bin/magento cache:flush
- echo ">>> Magento development environment initialized successfully! 🎉"
|