mage2click / docker-magento-mutagen

Mage2click Docker-based development environment for Magento with mutagen.io sync for files on macOS
https://mage2.click
MIT License
68 stars 9 forks source link

Change Setup Behavior to Support Setup from Local Source Without Db #31

Closed davidalger closed 5 years ago

davidalger commented 5 years ago

Currently the README stipulates that if --magento-project is specified, the --magento-db must be specified as well. Based on the setup scripts currently implemented however, this requirement does not appear to be there for a technical implementation reason, so I would like to propose lifting the restriction. This will support setting up a Mage2Click based environment using a local source directory without having a database artifact already present.

With this change, either parameter may be specified independently of the other allowing the setup process to either run setup:install or import the database from the provided dump file, even when a local project source directory is given, allowing for greater flexibility during the setup process.

Example use case would be setting up a Magento Commerce project from scratch using composer meta packages, where there is most likely no database artifact available for import during setup:

create-project -q --repository=https://repo.magento.com/ \
  magento/project-enterprise-edition /tmp/magento2-project 2.3.x

mkdir /sites/magento2-project && pushd /sites/magento2-project

cat /server/proj/docker-magento-mutagen/lib/setup | bash -s -- \
  --domain=magento2-project.test \
  --magento-project=/tmp/magento2-project \
  --varnish \
  && rm -rf /tmp/magento2-project
u-maxx commented 5 years ago

Thank you @davidalger!