File tree 4 files changed +81
-4
lines changed
4 files changed +81
-4
lines changed Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
- docker-compose exec -e COMPOSER_MEMORY_LIMIT=-1 php-fpm composer $*
3
+ # List of possible php containers
4
+ CONTAINERS=(" php-fpm" " php-fpm-xdebug" )
5
+
6
+ # Find the active container
7
+ for CONTAINER in " ${CONTAINERS[@]} " ; do
8
+ if docker-compose ps --services --filter " status=running" | grep -q " ^${CONTAINER} $" ; then
9
+ ACTIVE_CONTAINER=$CONTAINER
10
+ break
11
+ fi
12
+ done
13
+
14
+ # Check if an active container is found
15
+ if [ -z " $ACTIVE_CONTAINER " ]; then
16
+ echo " No container of ${CONTAINERS[*]} inactive."
17
+ exit 1
18
+ fi
19
+
20
+ echo " The container is used: $ACTIVE_CONTAINER "
21
+
22
+ docker-compose exec -e COMPOSER_MEMORY_LIMIT=-1 " $ACTIVE_CONTAINER " composer " $@ "
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
- docker-compose exec -T php-fpm /home/magento/bin/magento $*
3
+ # List of possible php containers
4
+ CONTAINERS=(" php-fpm" " php-fpm-xdebug" )
5
+
6
+ # Find the active container
7
+ for CONTAINER in " ${CONTAINERS[@]} " ; do
8
+ if docker-compose ps --services --filter " status=running" | grep -q " ^${CONTAINER} $" ; then
9
+ ACTIVE_CONTAINER=$CONTAINER
10
+ break
11
+ fi
12
+ done
13
+
14
+ # Check if an active container is found
15
+ if [ -z " $ACTIVE_CONTAINER " ]; then
16
+ echo " No container of ${CONTAINERS[*]} inactive."
17
+ exit 1
18
+ fi
19
+
20
+ echo " The container is used: $ACTIVE_CONTAINER "
21
+
22
+ docker-compose exec -T " $ACTIVE_CONTAINER " /home/magento/bin/magento " $@ "
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
- docker-compose exec -T php-fpm /usr/local/bin/n98-magerun2 $*
3
+ # List of possible php containers
4
+ CONTAINERS=(" php-fpm" " php-fpm-xdebug" )
5
+
6
+ # Find the active container
7
+ for CONTAINER in " ${CONTAINERS[@]} " ; do
8
+ if docker-compose ps --services --filter " status=running" | grep -q " ^${CONTAINER} $" ; then
9
+ ACTIVE_CONTAINER=$CONTAINER
10
+ break
11
+ fi
12
+ done
13
+
14
+ # Check if an active container is found
15
+ if [ -z " $ACTIVE_CONTAINER " ]; then
16
+ echo " No container of ${CONTAINERS[*]} inactive."
17
+ exit 1
18
+ fi
19
+
20
+ echo " The container is used: $ACTIVE_CONTAINER "
21
+
22
+ docker-compose exec -T " $ACTIVE_CONTAINER " /usr/local/bin/n98-magerun2 " $@ "
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
- docker-compose exec -T php-fpm php $*
3
+ # List of possible php containers
4
+ CONTAINERS=(" php-fpm" " php-fpm-xdebug" )
5
+
6
+ # Find the active container
7
+ for CONTAINER in " ${CONTAINERS[@]} " ; do
8
+ if docker-compose ps --services --filter " status=running" | grep -q " ^${CONTAINER} $" ; then
9
+ ACTIVE_CONTAINER=$CONTAINER
10
+ break
11
+ fi
12
+ done
13
+
14
+ # Check if an active container is found
15
+ if [ -z " $ACTIVE_CONTAINER " ]; then
16
+ echo " No container of ${CONTAINERS[*]} inactive."
17
+ exit 1
18
+ fi
19
+
20
+ echo " The container is used: $ACTIVE_CONTAINER "
21
+
22
+ # Execution of the command
23
+ docker-compose exec -T " $ACTIVE_CONTAINER " php " $@ "
You can’t perform that action at this time.
0 commit comments