-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathjustfile
More file actions
executable file
·138 lines (114 loc) · 2.74 KB
/
justfile
File metadata and controls
executable file
·138 lines (114 loc) · 2.74 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#!/usr/bin/env just --justfile
set quiet := true
sail := "./vendor/bin/sail"
# show help
help:
just --list
# Install Composer dependencies (w/o Sail)
[group('project')]
_composer-install:
test -d 'vendor' && echo "Vendor directory exists, skip" || docker run --rm \
-u "$(id -u):$(id -g)" \
-v "$(pwd):/var/www/html" \
-w /var/www/html \
laravelsail/php82-composer:latest \
composer install --ignore-platform-reqs
# Build Laravel Sail application image
[group('project')]
build:
test -f '.env' && echo "Env file exists, skip" || cp .env.example .env
just _composer-install
{{sail}} build --no-cache
just start
just deps
just migrate
just stop
# Start Laravel Sail containers
[group('project')]
start:
{{sail}} up -d
# Restart Laravel Sail containers
[group('project')]
restart:
{{sail}} restart
# Stop Laravel Sail containers
[group('project')]
stop:
{{sail}} down
# Stop Laravel Sail containers and remove volumes
[group('project')]
purge:
{{sail}} down -v
# Install Composer dependencies
[group('sail')]
deps:
{{sail}} composer install
# Attach PHP container console
[group('sail')]
shell:
{{sail}} shell
# Run Laravel scheduler (cron)
[group('sail')]
schedule:
{{sail}} artisan schedule:work
# Run Laravel worker (queue)
[group('sail')]
queue:
{{sail}} artisan queue:listen -v --timeout=0
# Run command inside of Laravel Sail PHP container, e.g. [just sail artisan help]
[group('sail')]
sail +command:
{{sail}} {{command}}
# Optimize Laravel cache
[group('sail')]
cache:
{{sail}} artisan optimize
{{sail}} artisan event:cache
{{sail}} artisan config:cache
{{sail}} artisan route:cache
{{sail}} artisan view:cache
{{sail}} artisan storage:link
# Clear Laravel cache
[group('sail')]
cache-clear:
{{sail}} artisan cache:clear
{{sail}} artisan config:clear
{{sail}} artisan event:clear
{{sail}} artisan optimize:clear
{{sail}} artisan route:clear
{{sail}} artisan view:clear
# Run Laravel Sail application tests
[group('sail')]
test:
{{sail}} test
# Run database migrations
[group('sql')]
migrate:
{{sail}} artisan migrate
# Attach SQL container console
[group('sql')]
sql:
{{sail}} artisan db
# Recreate database from scratch
[group('sql')]
migrate-fresh:
{{sail}} artisan migrate:fresh
# Seed initial records into database
[group('sql')]
seed:
{{sail}} artisan migrate:fresh --seed
# Generate Laravel stubs and model comments
[group('tools')]
stubs:
{{sail}} artisan clear-compiled
{{sail}} artisan ide-helper:models -W
just fmt
# Run Code Style formatter
[group('tools')]
fmt:
{{sail}} composer fmt
# Run static analysis
[group('tools')]
lint:
{{sail}} composer validate
{{sail}} composer lint