|
1 | 1 | #!/usr/bin/env bash |
2 | 2 |
|
3 | | -SHOPWARE_VERSION=$1 |
| 3 | +SHOPWARE_VERSION=$2 |
| 4 | + |
| 5 | +# Remove Shopware-Version from `$@`, so it is not passed to docker-compose command |
| 6 | +for arg do |
| 7 | + shift |
| 8 | + case $arg in |
| 9 | + (52|53|54|55) : ;; |
| 10 | + (*) set -- "$@" "$arg" ;; |
| 11 | + |
| 12 | + esac |
| 13 | +done |
| 14 | + |
4 | 15 |
|
5 | 16 | if [ -z "${SHOPWARE_VERSION}" ]; then |
6 | 17 | echo "You must provide the version of shopware you want to interact with, e.g. 54 for shopware 5.4" |
|
31 | 42 | export PROJECT_DIR="$( dirname $( dirname $( dirname "${PACKAGE_DIR}") ) )" |
32 | 43 | export PACKAGE_DIR="${PACKAGE_DIR}" |
33 | 44 | export PROJECT_NAME="$( basename ${PROJECT_DIR} | tr '[:upper:]' '[:lower:]' )" |
34 | | -export DOCKER_COMPOSE_YAML=${PROJECT_DIR}"/etc/test/docker-compose.yml" |
| 45 | +export DOCKER_COMPOSE_YAML=${PROJECT_DIR}"/etc/test/docker-compose${SHOPWARE_VERSION}.yml" |
35 | 46 |
|
36 | 47 | if [ "$1" != "init" ]; then |
37 | 48 | source ${PACKAGE_DIR}/etc/scripts/checkSdTestEnvironment.sh |
@@ -71,7 +82,7 @@ function init_environment { |
71 | 82 | cp ${PACKAGE_DIR}/README.md ${PROJECT_DIR}/README.TESTING.md |
72 | 83 |
|
73 | 84 | echo "Copying docker-compose.yml to be able to easily modify it for special needs" |
74 | | - cp ${PACKAGE_DIR}/docker-compose${SHOPWARE_VERSION}.yml ${PROJECT_DIR}/etc/test/docker-compose.yml |
| 85 | + cp ${PACKAGE_DIR}/docker-compose${SHOPWARE_VERSION}.yml ${PROJECT_DIR}/etc/test/docker-compose${SHOPWARE_VERSION}.yml |
75 | 86 |
|
76 | 87 | echo "Copying config files to be able to easily modify it for special needs" |
77 | 88 | cp ${PACKAGE_DIR}/php/* ${PROJECT_DIR}/etc/test/php |
@@ -181,6 +192,6 @@ case "$1" in |
181 | 192 | get_logs $@ |
182 | 193 | ;; |
183 | 194 | *) |
184 | | - echo "usage: init/start/stop/run/restart/build/reset/remove/pull/logs" |
| 195 | + echo "usage: init/start/stop/run/restart/build/reset/remove/pull/logs <Shopware-Version, e.g. 54 for shopware 5.4>" |
185 | 196 | ;; |
186 | 197 | esac |
0 commit comments