Skip to content

Commit 60bcade

Browse files
authored
MCLOUD-5982: Added PHP container script (Remove any PHP requirement for Config build) (#209)
1 parent a7cd184 commit 60bcade

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

dist/bin/magento-docker

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,21 @@ USAGE="Magento Cloud Docker
1919
flush-redis clears redis cache
2020
flush-varnish clears varnish cache
2121
ece-db access to Database
22+
php 7.1 run a command in a PHP 7.1 container
23+
php 7.2 run a command in a PHP 7.2 container
24+
php 7.3 run a command in a PHP 7.3 container
25+
php 7.4 run a command in a PHP 7.4 container
2226
2327
\033[33mOptions:\033[0m
2428
-h show this help text\n"
2529

26-
if [ ${#@} -ne 0 ] && [ "${@#"-h"}" = "" ]; then
27-
printf "$USAGE"
28-
exit 0;
30+
if [ ${#@} -ne 0 ]; then
31+
for arg in "$@"; do
32+
if [ "${arg#"-h"}" = "" ]; then
33+
printf "$USAGE"
34+
exit 0;
35+
fi
36+
done
2937
fi;
3038

3139
case "$1" in
@@ -74,6 +82,11 @@ case "$1" in
7482
ece-db)
7583
docker-compose exec db sh -c 'mysql -u $MYSQL_USER -p$MYSQL_PASSWORD $MYSQL_DATABASE "$@"'
7684
;;
85+
php)
86+
version="$2"
87+
shift 2
88+
docker run --rm -it -e "MAGENTO_ROOT=/app" -v "$(pwd)":/app -v ~/.composer/cache:/root/.composer/cache "magento/magento-cloud-docker-php:${version}-cli" "$@"
89+
;;
7790
*)
7891
printf "$USAGE"
7992
exit 0;

0 commit comments

Comments
 (0)