setup-pwa-studio-sampledata 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. #!/usr/bin/env bash
  2. set +e
  3. RED='\033[0;31m'
  4. GREEN='\033[0;32m'
  5. NC='\033[0m'
  6. BASE_URL=${1:-master-7rqtwti-mfwmkrjfqvbjk.us-4.magentosite.cloud}
  7. install_sampledata() {
  8. echo -e "${GREEN}Setting up composer repository for Venia sample data.${NC}"
  9. bin/composer config --no-interaction --ansi repositories.venia-sample-data composer https://repo.magento.com
  10. echo -e "${GREEN}Requiring Venia sample data metapackage.${NC}"
  11. bin/composer require --no-interaction --ansi magento/venia-sample-data:*
  12. echo -e "${GREEN}Installing Venia sample data modules.${NC}"
  13. bin/magento setup:upgrade
  14. echo -e "${GREEN}Reindexing the data from the modules.${NC}"
  15. bin/magento indexer:reindex
  16. }
  17. install_sampledata
  18. ENV_DIST_FILE="packages/venia-concept/.env.dist"
  19. if [ -f "$ENV_DIST_FILE" ]; then
  20. cp "$ENV_DIST_FILE" packages/venia-concept/.env
  21. else
  22. echo -e "${RED}.env.dist file not found. Continuing without copying.${NC}"
  23. fi
  24. echo -e "${GREEN}Script completed successfully.${NC}"
  25. echo "You may now access your Magento PWA Studio instance at https://${BASE_URL}/"