A magento2 sample project using magento2 dev docker
git clone https://github.com/readymadehost/magento2-dev-docker.git magento2-sample-dockercd magento2-sample-dockergit clone https://github.com/readymadehost/magento2-dev-docker-sample.git projectcp .env.sample .envand review.envfiledocker-compose builddocker-compose up -ddocker-compose exec cli bashcomposer installto install php packagesmppto manage project permission- Run
bin/magentoand should return list of commands - Magento2.4.x project install command https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli.html
- Setup sample data
bin/magento sampledata:deploy bin/magento setup:upgrade- Run bash alis
mppfor/root/manage-project-permission.sh
bin/magento setup:install \
--base-url=http://localhost:8080 \
--db-host=mariadb \
--db-name=project \
--db-user=root \
--db-password=root \
--backend-frontname=admin \
--admin-firstname=admin \
--admin-lastname=admin \
[email protected] \
--admin-user=admin \
--admin-password=admin@123 \
--language=en_US \
--currency=USD \
--timezone=America/Chicago \
--use-rewrites=1 \
--search-engine=elasticsearch7 \
--elasticsearch-host=elasticsearch \
--elasticsearch-port=9200
- Goto: Repository > Settings > Secrets > New repository secret
- Name:
COMPOSER_AUTH_JSONand Value as needed
{
"http-basic": {
"repo.magento.com": {
"username": "<public-key>",
"password": "<private-key>"
}
}
}docker-compose exec -T mariadb mysql -u root -proot -e "DROP DATABASE magento_integration_tests;"to drop magento_integration_tests database if existdocker-compose exec -T mariadb mysql -u root -proot -e "CREATE DATABASE magento_integration_tests;"to create fresh test databasedocker-compose exec cli bashcp magento2-dev-docker/install-config-mysql.php dev/tests/integration/etc/install-config-mysql.phprm -rf generated/* && bin/magento cache:cleanbin/magento dev:tests:runto run tests
Magento2 dev docker has database, extensions, elasticsearch and everything needed to work with magento2 tests. Github actions are configured for sample project, check https://github.com/readymadehost/magento2-dev-docker-sample/blob/master/.github/workflows/tests.yml
Create an issue if you have any questions.