download 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. if [ -d "./bin" ]; then
  10. echo "Error: The current directory is not empty. Please remove all contents within this directory and try again."
  11. exit 1
  12. fi
  13. bin/start --no-dev
  14. [ $? != 0 ] && echo "Failed to start Docker services" && exit
  15. bin/setup-composer-auth
  16. bin/fixowns
  17. if [ "$EDITION" == "mageos-nightly" ]; then
  18. bin/clinotty composer create-project --stability alpha --repository-url=https://upstream-nightly.mage-os.org magento/project-community-edition .
  19. elif [ "$EDITION" == "mageos-mirror" ] || [ "$EDITION" == "mageos" ]; then
  20. bin/clinotty composer create-project --repository-url=https://mirror.mage-os.org magento/project-community-edition="${VERSION}" .
  21. elif [ "$EDITION" == "mageos-hypernode-mirror" ]; then
  22. bin/clinotty composer create-project --repository-url=https://mage-os.hypernode.com/mirror magento/project-community-edition="${VERSION}" .
  23. elif [ "$EDITION" == "mageos-maxcluster-mirror" ]; then
  24. bin/clinotty composer create-project --repository-url=https://mage-os.maxcluster.net/mirror magento/project-community-edition="${VERSION}" .
  25. else
  26. bin/clinotty composer create-project --repository=https://repo.magento.com/ magento/project-"${EDITION}"-edition="${VERSION}" .
  27. fi
  28. if [ $? != 0 ]; then
  29. 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}"
  30. else
  31. 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
  32. fi