forked from clickds/app-purchase-notifications
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdevelop
executable file
·34 lines (29 loc) · 810 Bytes
/
develop
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env bash
# Set environment variables for dev
export APP_PORT=${APP_PORT:-80}
COMPOSE="docker-compose"
# if any arguments pass to docker compose otherwise run docker-compose ps
if [ $# -gt 0 ];then
# If "composer" is used, pass-thru to "composer"
# inside a new container
if [ "$1" == "composer" ]; then
shift 1
$COMPOSE run --rm \
-w /var/www/html \
app \
composer "$@"
# If "test" is used, run unit tests,
# pass-thru any extra arguments to php-unit
elif [ "$1" == "test" ]; then
shift 1
$COMPOSE run --rm \
-w /var/www/html \
app \
./vendor/bin/phpunit "$@"
# Else, pass-thru args to docker-compose
else
$COMPOSE "$@"
fi
else
$COMPOSE ps
fi