Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions bin/sdPlugin.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
#!/usr/bin/env bash
VERSION=$1
PHP_VERSION=$1
SHOPWARE_VERSION=$2

if [ -z "${VERSION}" ]; then
if [ -z "${SHOPWARE_VERSION}" ]; then
echo "You must provide the version of shopware you want to interact with, e.g. 54 for shopware 5.4"
exit 1
fi


if [ -z "${PHP_VERSION}" ]; then
echo "You must give a version to execute command on, for example 71 for PHP 7.1 container."
exit 1
fi
Expand All @@ -25,8 +32,8 @@ fi
PROJECT_DIR="$( dirname $( dirname $( dirname "${PACKAGE_DIR}") ) )"
PROJECT_NAME="$( basename ${PROJECT_DIR} | tr '[:upper:]' '[:lower:]' )"
# TODO: Think about a good solution for a different shopware version
PHP_CONTAINER_NAME="${PROJECT_NAME}_shopware54_php${VERSION}_1"
WORK_DIR="/var/www/shopware54_php${VERSION}"
PHP_CONTAINER_NAME="${PROJECT_NAME}_shopware${SHOPWARE_VERSION}_php${PHP_VERSION}_1"
WORK_DIR="/var/www/shopware${SHOPWARE_VERSION}_php${PHP_VERSION}"

PLUGIN_NAME=$(find . -name '*.php' -maxdepth 1 |sed 's#.*/##' | sed 's/\.php$//1')

Expand Down Expand Up @@ -74,7 +81,7 @@ function execute_in_docker {
export PROJECT_DIR
export PROJECT_NAME

case "$2" in
case "$3" in
add)
shift
add_plugin $@
Expand All @@ -92,6 +99,7 @@ case "$2" in
deactivate_plugin $@
;;
*)
echo "usage: <php-version for example 71> add/remove/activate/deactivate"
echo "usage: <php-version for example 71> [shopware-version] add/remove/activate/deactivate"
echo "valid values for shopware-version: 52 | 53 | 54 | 55 (default)"
;;
esac
19 changes: 17 additions & 2 deletions bin/sdRunInTest.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
#!/usr/bin/env bash

VERSION=$1
SHOPWARE_VERSION=$2

# Remove Shopware-Version from `$@`, so it is not passed to docker-compose command
for arg do
shift
case $arg in
(52|53|54|55) : ;;
(*) set -- "$@" "$arg" ;;
esac
done

if [ -z "${SHOPWARE_VERSION}" ]; then
echo "You must provide the version of shopware you want to interact with, e.g. 54 for shopware 5.4"
exit 1
fi

if [ -z "${VERSION}" ]; then
echo "You must give a version to execute command on, for example 71 for PHP 7.1 container."
Expand All @@ -26,7 +41,7 @@ fi
PROJECT_DIR="$( dirname $( dirname $( dirname "${PACKAGE_DIR}") ) )"
PROJECT_NAME="$( basename ${PROJECT_DIR} | tr '[:upper:]' '[:lower:]' )"
# TODO: Think about a good solution for a different shopware version
PHP_CONTAINER_NAME="${PROJECT_NAME}_shopware54_php${VERSION}_1"
WORK_DIR=${WORK_DIR:-"/var/www/shopware54_php${VERSION}"}
PHP_CONTAINER_NAME="${PROJECT_NAME}_shopware${SHOPWARE_VERSION}_php${VERSION}_1"
WORK_DIR=${WORK_DIR:-"/var/www/shopware${SHOPWARE_VERSION}_php${VERSION}"}

docker exec --workdir ${WORK_DIR} -it $(docker container ls -f name=${PHP_CONTAINER_NAME} -q) ${@:2}
34 changes: 26 additions & 8 deletions bin/sdTest.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
#!/usr/bin/env bash

SHOPWARE_VERSION=$2

# Remove Shopware-Version from `$@`, so it is not passed to docker-compose command
for arg do
shift
case $arg in
(52|53|54|55) : ;;
(*) set -- "$@" "$arg" ;;

esac
done


if [ -z "${SHOPWARE_VERSION}" ]; then
echo "You must provide the version of shopware you want to interact with, e.g. 54 for shopware 5.4"
exit 1
fi

# directory of this script
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

Expand All @@ -24,7 +42,7 @@ fi
export PROJECT_DIR="$( dirname $( dirname $( dirname "${PACKAGE_DIR}") ) )"
export PACKAGE_DIR="${PACKAGE_DIR}"
export PROJECT_NAME="$( basename ${PROJECT_DIR} | tr '[:upper:]' '[:lower:]' )"
export DOCKER_COMPOSE_YAML=${PROJECT_DIR}"/etc/test/docker-compose.yml"
export DOCKER_COMPOSE_YAML=${PROJECT_DIR}"/etc/test/docker-compose${SHOPWARE_VERSION}.yml"

if [ "$1" != "init" ]; then
source ${PACKAGE_DIR}/etc/scripts/checkSdTestEnvironment.sh
Expand All @@ -41,11 +59,11 @@ function prepare {
function echo_configuration {
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo "Running (web)server on ports:"
echo "PHP 7.2: 10872"
echo "PHP 7.1: 10871"
echo "PHP 7.0: 10870"
echo "PHP 5.6: 10856"
echo "MySQL: 10331"
echo "PHP 7.2: ${SHOPWARE_VERSION}872"
echo "PHP 7.1: ${SHOPWARE_VERSION}871"
echo "PHP 7.0: ${SHOPWARE_VERSION}870"
echo "PHP 5.6: ${SHOPWARE_VERSION}856"
echo "MySQL: ${SHOPWARE_VERSION}331"
echo ""
echo "PROJECT_DIR: ${PROJECT_DIR}"
echo "PROJECT_NAME: ${PROJECT_NAME}"
Expand All @@ -64,7 +82,7 @@ function init_environment {
cp ${PACKAGE_DIR}/README.md ${PROJECT_DIR}/README.TESTING.md

echo "Copying docker-compose.yml to be able to easily modify it for special needs"
cp ${PACKAGE_DIR}/docker-compose.yml ${PROJECT_DIR}/etc/test/docker-compose.yml
cp ${PACKAGE_DIR}/docker-compose${SHOPWARE_VERSION}.yml ${PROJECT_DIR}/etc/test/docker-compose${SHOPWARE_VERSION}.yml

echo "Copying config files to be able to easily modify it for special needs"
cp ${PACKAGE_DIR}/php/* ${PROJECT_DIR}/etc/test/php
Expand Down Expand Up @@ -174,6 +192,6 @@ case "$1" in
get_logs $@
;;
*)
echo "usage: init/start/stop/run/restart/build/reset/remove/pull/logs"
echo "usage: init/start/stop/run/restart/build/reset/remove/pull/logs <Shopware-Version, e.g. 54 for shopware 5.4>"
;;
esac
90 changes: 90 additions & 0 deletions docker-compose52.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
version: '3'

services:
nginx:
image: nginx:1.15-alpine
environment:
- TZ=Europe/Berlin
ports:
- "52870:52870"
- "52871:52871"
- "52872:52872"
volumes:
- shopware52_php72:/var/www/shopware52_php72:delegated
- shopware52_php71:/var/www/shopware52_php71:delegated
- shopware52_php70:/var/www/shopware52_php70:delegated
- ${PROJECT_DIR}:/opt/host:delegated
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ./nginx/include.shopware.conf:/etc/nginx/include.shopware.conf
- ./nginx/conf.d/default.conf:/etc/nginx/conf.d/default.conf
links:
- shopware52_php72
- shopware52_php71
- shopware52_php70
- mysql
depends_on:
- shopware52_php72
- shopware52_php71
- shopware52_php70

shopware52_php72:
image: solutiondrive/docker-shopware-container:shopware5.2.27-php7.2
environment:
- TZ=Europe/Berlin
- DB_DATABASE=shopware52_php72
- WEB_HOST=localhost:52872
volumes:
- shopware52_php72:/var/www/shopware52_php72:delegated
- ${PROJECT_DIR}:/opt/host:delegated
- ./php/php.ini:/usr/local/etc/php/conf.d/zzz-override-php.ini
- ./php/www.conf:/usr/local/etc/php-fpm.d/www.conf
links:
- mysql
depends_on:
- mysql

shopware52_php71:
image: solutiondrive/docker-shopware-container:shopware5.2.27-php7.1
environment:
- TZ=Europe/Berlin
- DB_DATABASE=shopware52_php71
- WEB_HOST=localhost:52871
volumes:
- shopware52_php71:/var/www/shopware52_php71:delegated
- ${PROJECT_DIR}:/opt/host:delegated
- ./php/php.ini:/usr/local/etc/php/conf.d/zzz-override-php.ini
- ./php/www.conf:/usr/local/etc/php-fpm.d/www.conf
links:
- mysql
depends_on:
- mysql

shopware52_php70:
image: solutiondrive/docker-shopware-container:shopware5.2.27-php7.0
environment:
- TZ=Europe/Berlin
- DB_DATABASE=shopware52_php70
- WEB_HOST=localhost:52870
volumes:
- shopware52_php70:/var/www/shopware52_php70:delegated
- ${PROJECT_DIR}:/opt/host:delegated
- ./php/php.ini:/usr/local/etc/php/conf.d/zzz-override-php.ini
- ./php/www.conf:/usr/local/etc/php-fpm.d/www.conf
links:
- mysql
depends_on:
- mysql

mysql:
image: mysql:5.7.20
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_ALLOW_EMPTY_PASSWORD=false
- MYSQL_DATABASE=test
ports:
- "52331:3306"

volumes:
shopware52_php72:
shopware52_php71:
shopware52_php70:
90 changes: 90 additions & 0 deletions docker-compose53.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
version: '3'

services:
nginx:
image: nginx:1.15-alpine
environment:
- TZ=Europe/Berlin
ports:
- "53870:53870"
- "53871:53871"
- "53872:53872"
volumes:
- shopware53_php72:/var/www/shopware53_php72:delegated
- shopware53_php71:/var/www/shopware53_php71:delegated
- shopware53_php70:/var/www/shopware53_php70:delegated
- ${PROJECT_DIR}:/opt/host:delegated
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ./nginx/include.shopware.conf:/etc/nginx/include.shopware.conf
- ./nginx/conf.d/default.conf:/etc/nginx/conf.d/default.conf
links:
- shopware53_php72
- shopware53_php71
- shopware53_php70
- mysql
depends_on:
- shopware53_php72
- shopware53_php71
- shopware53_php70

shopware53_php72:
image: solutiondrive/docker-shopware-container:shopware5.3.7-php7.2
environment:
- TZ=Europe/Berlin
- DB_DATABASE=shopware53_php72
- WEB_HOST=localhost:53872
volumes:
- shopware53_php72:/var/www/shopware53_php72:delegated
- ${PROJECT_DIR}:/opt/host:delegated
- ./php/php.ini:/usr/local/etc/php/conf.d/zzz-override-php.ini
- ./php/www.conf:/usr/local/etc/php-fpm.d/www.conf
links:
- mysql
depends_on:
- mysql

shopware53_php71:
image: solutiondrive/docker-shopware-container:shopware5.3.7-php7.1
environment:
- TZ=Europe/Berlin
- DB_DATABASE=shopware53_php71
- WEB_HOST=localhost:53871
volumes:
- shopware53_php71:/var/www/shopware53_php71:delegated
- ${PROJECT_DIR}:/opt/host:delegated
- ./php/php.ini:/usr/local/etc/php/conf.d/zzz-override-php.ini
- ./php/www.conf:/usr/local/etc/php-fpm.d/www.conf
links:
- mysql
depends_on:
- mysql

shopware53_php70:
image: solutiondrive/docker-shopware-container:shopware5.3.7-php7.0
environment:
- TZ=Europe/Berlin
- DB_DATABASE=shopware53_php70
- WEB_HOST=localhost:53870
volumes:
- shopware53_php70:/var/www/shopware53_php70:delegated
- ${PROJECT_DIR}:/opt/host:delegated
- ./php/php.ini:/usr/local/etc/php/conf.d/zzz-override-php.ini
- ./php/www.conf:/usr/local/etc/php-fpm.d/www.conf
links:
- mysql
depends_on:
- mysql

mysql:
image: mysql:5.7.20
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_ALLOW_EMPTY_PASSWORD=false
- MYSQL_DATABASE=test
ports:
- "53331:3306"

volumes:
shopware53_php72:
shopware53_php71:
shopware53_php70:
14 changes: 7 additions & 7 deletions docker-compose.yml → docker-compose54.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ services:
environment:
- TZ=Europe/Berlin
ports:
- "10870:10870"
- "10871:10871"
- "10872:10872"
- "54870:54870"
- "54871:54871"
- "54872:54872"
volumes:
- shopware54_php72:/var/www/shopware54_php72:delegated
- shopware54_php71:/var/www/shopware54_php71:delegated
Expand All @@ -32,7 +32,7 @@ services:
environment:
- TZ=Europe/Berlin
- DB_DATABASE=shopware54_php72
- WEB_HOST=localhost:10872
- WEB_HOST=localhost:54872
volumes:
- shopware54_php72:/var/www/shopware54_php72:delegated
- ${PROJECT_DIR}:/opt/host:delegated
Expand All @@ -48,7 +48,7 @@ services:
environment:
- TZ=Europe/Berlin
- DB_DATABASE=shopware54_php71
- WEB_HOST=localhost:10871
- WEB_HOST=localhost:54871
volumes:
- shopware54_php71:/var/www/shopware54_php71:delegated
- ${PROJECT_DIR}:/opt/host:delegated
Expand All @@ -64,7 +64,7 @@ services:
environment:
- TZ=Europe/Berlin
- DB_DATABASE=shopware54_php70
- WEB_HOST=localhost:10870
- WEB_HOST=localhost:54870
volumes:
- shopware54_php70:/var/www/shopware54_php70:delegated
- ${PROJECT_DIR}:/opt/host:delegated
Expand All @@ -82,7 +82,7 @@ services:
- MYSQL_ALLOW_EMPTY_PASSWORD=false
- MYSQL_DATABASE=test
ports:
- "10331:3306"
- "54331:3306"

volumes:
shopware54_php72:
Expand Down
Loading