-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathcommands
executable file
·62 lines (48 loc) · 1.36 KB
/
commands
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
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env bash
if [ $# -gt 0 ]; then
if [ "$1" == "rebuild" ]; then
docker-compose up --build -d
elif [ "$1" == "start" ]; then
docker-compose up -d
elif [ "$1" == "stop" ]; then
docker-compose stop
elif [ "$1" == "remove" ]; then
docker-compose down -v
elif [ "$1" == "logs" ]; then
docker-compose logs -f -t
elif [ "$1" == "stats" ]; then
docker stats $(docker inspect -f '{{.Name}}' $(docker ps -q) | cut -c 2-)
elif [ "$1" == "artisan" ] || [ "$1" == "art" ]; then
shift 1
docker-compose exec \
app \
php artisan "$@"
elif [ "$1" == "mysql" ]; then
shift 1
docker-compose exec \
db \
bash -c 'MYSQL_PWD=$MYSQL_ROOT_PASSWORD mysql -u root $MYSQL_DATABASE'
elif [ "$1" == "composer" ] || [ "$1" == "comp" ]; then
shift 1
docker-compose exec \
app \
composer "$@"
elif [ "$1" == "npm" ]; then
shift 1
docker-compose run --rm \
node \
npm "$@"
elif [ "$1" == "yarn" ]; then
shift 1
docker-compose run --rm \
node \
yarn "$@"
elif [ "$1" == "exec" ]; then
shift 1
docker exec -it "$@"
else
docker-compose "$@"
fi
else
docker-compose ps
fi