https://github.com/netlogix/nlxbacktotopbutton
https://github.com/netlogix/nlxbacktotopbutton
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/netlogix/nlxbacktotopbutton
- Owner: netlogix
- License: other
- Created: 2021-11-19T14:19:54.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-02T11:01:05.000Z (over 2 years ago)
- Last Synced: 2025-03-17T10:09:01.233Z (2 months ago)
- Language: Shell
- Size: 33.2 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.TESTING.md
- License: LICENSE
Awesome Lists containing this project
README
Docker based Shopware Testing Environment
=========================================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.6.x simply run the following:
vendor/bin/sdTest.sh init 56
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 needsUsage / 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. 72 for PHP 7.2 container and 56 for Shopware 5.6 :For adding the plugin run:
vendor/bin/sdPlugin.sh 72 56 add
For removing the plugin run:vendor/bin/sdPlugin.sh 72 56 remove
For activating the plugin run:vendor/bin/sdPlugin.sh 72 56 activate
For deactivating the plugin run:vendor/bin/sdPlugin.sh 72 56 deactivate
Controlling the testing environment
-----------------------------------List of SHOPWARE_VERSION:
- 56 -> v5.6.xTo start the containers e.g. with shopware 5.6 and get back your local shell just run:
vendor/bin/sdTest.sh start 56
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 --pullTo 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. 72 for PHP 7.2 container and 56 for Shopware 5.6.x:vendor/bin/sdRunInTest.sh 72 56 ./app/install.sh
If you want to you can even get a shell inside the PHP container:
vendor/bin/sdRunInTest.sh 72 56 /bin/bash