download 997 B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/bash
  2. VERSION=${1:-2.4.5-p1}
  3. EDITION=${2:-community}
  4. bin/stop
  5. # Translate version to root in integer format. Ex. 2.4.3-p1 -> 243
  6. VERSION_ROOT=$(echo "$VERSION" | cut -b 1-5 | sed -e 's/\.//g')
  7. if (( $(echo "$VERSION_ROOT < 244" | bc -l) )); then
  8. sed -i -e 's/8.1\-fpm\-1/7.4\-fpm\-15/g' compose.yaml
  9. else
  10. sed -i -e 's/7.4\-fpm\-15/8.1\-fpm\-1/g' compose.yaml
  11. fi
  12. bin/start --no-dev
  13. [ $? != 0 ] && echo "Failed to start Docker services" && exit
  14. bin/setup-composer-auth
  15. bin/fixowns
  16. if [ "$EDITION" == "mageos" ]; then
  17. bin/clinotty composer create-project --stability alpha --repository-url=https://upstream-nightly.mage-os.org magento/project-community-edition .
  18. else
  19. bin/clinotty composer create-project --repository=https://repo.magento.com/ magento/project-"${EDITION}"-edition="${VERSION}" .
  20. fi
  21. 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