download 1.6 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #!/usr/bin/env bash
  2. VERSION=${1:-2.4.6-p4}
  3. EDITION=${2:-community}
  4. # Define ANSI escape codes for colors
  5. YELLOW='\033[0;33m'
  6. BLUE='\033[0;34m'
  7. NC='\033[0m' # No Color
  8. bin/stop
  9. bin/start --no-dev
  10. [ $? != 0 ] && echo "Failed to start Docker services" && exit
  11. bin/setup-composer-auth
  12. bin/fixowns
  13. if [ "$EDITION" == "mageos-nightly" ]; then
  14. bin/clinotty composer create-project --stability alpha --repository-url=https://upstream-nightly.mage-os.org magento/project-community-edition .
  15. elif [ "$EDITION" == "mageos-mirror" ] || [ "$EDITION" == "mageos" ]; then
  16. bin/clinotty composer create-project --repository-url=https://mirror.mage-os.org magento/project-community-edition="${VERSION}" .
  17. elif [ "$EDITION" == "mageos-hypernode-mirror" ]; then
  18. bin/clinotty composer create-project --repository-url=https://mage-os.hypernode.com/mirror magento/project-community-edition="${VERSION}" .
  19. elif [ "$EDITION" == "mageos-maxcluster-mirror" ]; then
  20. bin/clinotty composer create-project --repository-url=https://mage-os.maxcluster.net/mirror magento/project-community-edition="${VERSION}" .
  21. else
  22. bin/clinotty composer create-project --repository=https://repo.magento.com/ magento/project-"${EDITION}"-edition="${VERSION}" .
  23. fi
  24. if [ $? != 0 ]; then
  25. echo -e "${BLUE}Please check the installation guide at ${YELLOW}https://github.com/markshust/docker-magento#install-fails-because-project-directory-is-not-empty${BLUE} for troubleshooting.${NC}"
  26. else
  27. bin/clinotty [ ! -f "./var/composer_home/auth.json" ] && bin/clinotty mkdir -p ./var/composer_home && bin/clinotty cp /var/www/.composer/auth.json ./var/composer_home/auth.json
  28. fi