forked from hasib32/rest-api-with-lumen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdevelop
executable file
·44 lines (38 loc) · 1.08 KB
/
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
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env bash
# Set environment variables for dev
export APP_PORT=${APP_PORT:-80}
export DB_PORT=${DB_PORT:-3306}
export XDEBUG_HOST=$(ipconfig getifaddr en0) # Specific to Macintosh
COMPOSE="docker-compose"
# If we pass any arguments
if [ $# -gt 0 ];then
# If "art" or "artisan" is used, pass-thru to "artisan"
# inside a new container
if [ "$1" == "art" ] || [ "$1" == "artisan" ]; then
shift 1
$COMPOSE run --rm \
-w /var/www/html \
restapi-app \
php artisan "$@"
# If "composer" is used, pass-thru to "composer"
# inside a new container
elif [ "$1" == "composer" ];then
shift 1
$COMPOSE run --rm \
-w /var/www/html \
restapi-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 \
restapi-app \
./vendor/bin/phpunit "$@"
else
$COMPOSE "$@"
fi
else
$COMPOSE ps
fi