init 976 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/bash
  2. # Script to initialize a Magento development environment
  3. # Exit immediately if a command fails
  4. set -e
  5. echo ">>> Deploying Magento sample data..."
  6. bin/magento sampledata:deploy
  7. # Sample data requires standalone setup:upgrade exec to trigger activation
  8. echo ">>> Running setup upgrade to activate sample data..."
  9. bin/magento setup:upgrade
  10. echo ">>> Installing DisableTwoFactorAuth module for dev..."
  11. bin/composer require --dev markshust/magento2-module-disabletwofactorauth
  12. bin/magento module:enable MarkShust_DisableTwoFactorAuth
  13. bin/magento setup:upgrade
  14. echo ">>> Setting long admin session lifetime (1 year)..."
  15. bin/magento config:set twofactorauth/general/enable 0
  16. bin/magento config:set admin/security/session_lifetime 31536000
  17. echo ">>> Generating URN catalog for IDEs..."
  18. bin/dev-urn-catalog-generate
  19. echo ">>> Flushing cache to apply all updates..."
  20. bin/magento cache:flush
  21. echo ">>> Magento development environment initialized successfully! 🎉"