solutiondrive/sd-test-environment-shopware
Composer 安装命令:
composer require --dev solutiondrive/sd-test-environment-shopware
包简介
Docker based testing environment for shopware projects.
README 文档
README
For easier testing with different shopware- and/or php-versions we use a docker based environment. There are some docker containers providing MySQL, PHP and so on. The local filesystem is mapped into the containers that need them.
NOTE on this README
This file assumes that bin-scripts are installed to vendor/bin (as composer does by default).
If your changed this behaviour in your composer.json
you have to adjust the commands written in this file accordingly.
Installation
To use the testing environment in a project, add the following dependency to your project's composer.json's require-dev section:
"require-dev": {
"solutiondrive/sd-test-environment-shopware": "*"
}
Then do a composer update or use composer require --dev instead.
To initialize the testing environment, e.g. for Shopware 5.7.x simply run the following:
vendor/bin/sdTest.sh init 57
This will create some files:
/README.TESTING.md # This README.md in your project for other developers
/etc/test/docker-compose.yml # A docker-compose file which can be modified for special needs
Usage / First steps
First you should start the testing docker containers (see also next section of this README):
vendor/bin/sdTest.sh start SHOPWARE_VERSION
Handle plugin
For all following commands you must pass a php and shopware version, e.g. 74 for PHP 7.4 container and 57 for Shopware 5.7 :
For adding the plugin run:
vendor/bin/sdPlugin.sh 74 57 add
For removing the plugin run:
vendor/bin/sdPlugin.sh 74 57 remove
For activating the plugin run:
vendor/bin/sdPlugin.sh 74 57 activate
For deactivating the plugin run:
vendor/bin/sdPlugin.sh 74 57 deactivate
Controlling the testing environment
List of SHOPWARE_VERSION:
- 52 -> v5.2.x
- 53 -> v5.3.x
- 54 -> v5.4.x
- 55 -> v5.5.x
- 56 -> v5.6.x
- 57 -> v5.7.x
To start the containers e.g. with shopware 5.7 and get back your local shell just run:
vendor/bin/sdTest.sh start 57
To stop the containers run:
vendor/bin/sdTest.sh stop SHOPWARE_VERSION
In stopped state the containers data is saved.
To destroy your containers you can run:
vendor/bin/sdTest.sh remove SHOPWARE_VERSION
To restart your containers without loosing data you can run:
vendor/bin/sdTest.sh restart SHOPWARE_VERSION
Can can also run the containers in foreground to monitor the log output of the containers:
vendor/bin/sdTest.sh run SHOPWARE_VERSION
Then you can stop the execution by pressing CTRL+C. The containers will exit cleanly.
If you started the container in background using start, you can view the logs by running:
vendor/bin/sdTest.sh logs SHOPWARE_VERSION
You can follow the logs (as known from tail -f or tailf):
vendor/bin/sdTest.sh logs SHOPWARE_VERSION -f
To connect to the mysql server use 127.0.0.1 as host with port (default: 10331) configured in etc/test/docker-compose.yml.
Less frequently needed
To force a rebuild of the containers you can run:
vendor/bin/sdTest.sh build --no-cache
To be sure that you have the latest version of the (base) containers you can force pulling newer images:
vendor/bin/sdTest.sh build --no-cache --pull
To be sure to use the newest containers (not only build based containers):
vendor/bin/sdTest.sh pull SHOPWARE_VERSION
To destroy and restart your containers in one step without rebuilding images run:
vendor/bin/sdTest.sh reset SHOPWARE_VERSION
Executing a command in the testing environment
Commands (for example to clear the cache or to run the setup) can be executed inside the container. You must give a version of php and shopware to execute command on, e.g. 74 for PHP 7.4 container and 57 for Shopware 5.7.x:
vendor/bin/sdRunInTest.sh 74 57 ./app/install.sh
If you want to you can even get a shell inside the PHP container:
vendor/bin/sdRunInTest.sh 74 57 /bin/bash
solutiondrive/sd-test-environment-shopware 适用场景与选型建议
solutiondrive/sd-test-environment-shopware 是一款 基于 Shell 开发的 Composer 扩展包,目前已累计 15k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2018 年 08 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「testing」 「docker」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 solutiondrive/sd-test-environment-shopware 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 solutiondrive/sd-test-environment-shopware 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 solutiondrive/sd-test-environment-shopware 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Testing Suite For Lumen like Laravel does.
The Laragoon utility package
Docker compose for Robo Task Runner
Deployment command
The PHP SDK for Checkmango
The testing extension of TYPO3voilà.
统计信息
- 总下载量: 15k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 10
- 依赖项目数: 11
- 推荐数: 0
其他信息
- 授权协议: proprietary
- 更新时间: 2018-08-15