-
Notifications
You must be signed in to change notification settings - Fork 4
/
develop
executable file
·50 lines (41 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
45
46
47
48
49
50
#!/usr/bin/env bash
# Set script scope environment variables for dev or CI.
export APP_PORT=${APP_PORT:-80}
export DB_PORT=${DB_PORT:-3306}
export DB_ROOT_PASS=${DB_ROOT_PASS:-secret}
export DB_NAME=${DB_NAME:-replaque}
export DB_USER=${DB_USER:-replaque}
export DB_PASS=${DB_PASS:-secret}
COMPOSE="docker-compose -f docker-compose.yml"
# Pass arguments to docker-compose, or default to docker-compose ps.
if [[ $# -gt 0 ]]; then
case "$1" in
a|art|artisan )
shift 1
${COMPOSE} run --rm \
api \
php artisan "$@"
;;
c|com|composer )
shift 1
${COMPOSE} run --rm \
api \
composer "$@"
;;
phpunit|test )
shift 1
${COMPOSE} run --rm \
api \
php vendor/bin/phpunit "$@"
;;
n|npm )
shift 1
${COMPOSE} run --rm \
node \
npm "$@"
;;
* ) ${COMPOSE} "$@"; ;;
esac
else
${COMPOSE} ps
fi