-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathq
executable file
·65 lines (63 loc) · 2.23 KB
/
q
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
63
64
65
#! /bin/bash
if [[ "$1" == "test" ]]; then
shift
docker compose run --rm phpcli php artisan test "$@"
elif [[ "$1" == "migrate" ]]; then
shift
docker compose run --rm phpcli php artisan migrate "$@"
elif [[ "$1" == "composer" ]]; then
shift
docker compose run --rm phpcli composer "$@"
elif [[ "$1" == "php" ]]; then
shift
docker compose run --rm phpcli php "$@"
elif [[ "$1" == "artisan" ]]; then
shift
docker compose run --rm phpcli php artisan "$@"
elif [[ "$1" == "db:reset" ]]; then
shift
docker compose run --rm phpcli php artisan migrate:fresh --seed "$@"
elif [[ "$1" == "vite" ]]; then
shift
docker compose run --rm vite npm run dev
elif [[ "$1" == "node" ]]; then
shift
docker compose run --rm node "$@"
elif [[ "$1" == "ps" ]]; then
docker ps --format 'table {{.ID}}\t{{.Status}}\t{{.Names}}\t{{.Ports}}'
elif [[ "$1" == "up" ]]; then
shift
docker compose --env-file ./src/.env up "$@"
elif [[ "$1" == "down" ]]; then
docker compose --env-file ./src/.env down --remove-orphans
elif [[ "$1" == "restart" ]]; then
docker compose restart
elif [[ "$1" == "clear" ]]; then
docker container stop $(docker container ps -aq) && docker container rm $(docker container ps -aq)
elif [[ "$1" == "crp" ]]; then
rm -rf ./src/README.md && \
docker compose run --rm phpcli composer create-project laravel/laravel . && \
cd ./src && \
git init --initial-branch=main && \
git add . && git commit -m "Initial code commit"
# Add more elif blocks for other shortcuts
else
echo "Usage: $0 <command>"
echo "Available commands:"
echo "
ps show the docker processes
up start the compose services
down stop the composer services
restart restart the compose services
clear clear all containers
composer run composer commands
php run commands inside php container
artisan run artisan commands
db:reset run artisan migrate command to fresh the DB
vite run vite to compile assets
test run application tests and reach out to PEST binary
node run node container and any command on it
migrate run the migrations for the application
crp create-project
"
fi