1234567891011121314151617181920212223242526272829303132333435363738394041 |
- #!/usr/bin/env bash
- VERSION=${1:-2.4.6-p4}
- EDITION=${2:-community}
- # Define ANSI escape codes for colors
- YELLOW='\033[0;33m'
- BLUE='\033[0;34m'
- NC='\033[0m' # No Color
- bin/stop
- if [ -d "./bin" ]; then
- echo "Error: The current directory is not empty. Please remove all contents within this directory and try again."
- exit 1
- fi
- bin/start --no-dev
- [ $? != 0 ] && echo "Failed to start Docker services" && exit
- bin/setup-composer-auth
- bin/fixowns
- if [ "$EDITION" == "mageos-nightly" ]; then
- bin/clinotty composer create-project --stability alpha --repository-url=https://upstream-nightly.mage-os.org magento/project-community-edition .
- elif [ "$EDITION" == "mageos-mirror" ] || [ "$EDITION" == "mageos" ]; then
- bin/clinotty composer create-project --repository-url=https://mirror.mage-os.org magento/project-community-edition="${VERSION}" .
- elif [ "$EDITION" == "mageos-hypernode-mirror" ]; then
- bin/clinotty composer create-project --repository-url=https://mage-os.hypernode.com/mirror magento/project-community-edition="${VERSION}" .
- elif [ "$EDITION" == "mageos-maxcluster-mirror" ]; then
- bin/clinotty composer create-project --repository-url=https://mage-os.maxcluster.net/mirror magento/project-community-edition="${VERSION}" .
- else
- bin/clinotty composer create-project --repository=https://repo.magento.com/ magento/project-"${EDITION}"-edition="${VERSION}" .
- fi
- if [ $? != 0 ]; then
- 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}"
- else
- 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
- fi
|