forked from filamentphp/demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yaml
244 lines (204 loc) Β· 5.72 KB
/
Taskfile.yaml
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
# https://taskfile.dev
version: "3"
dotenv: ['.env']
tasks:
default:
cmds:
- task: help
build:
desc: Build containers
cmds:
- "docker compose build"
composer:
aliases: [c]
desc: Composer command
cmds:
- "docker compose run --rm php composer {{.CLI_ARGS}}"
composer-install-dev:
aliases: [ci]
desc: Composer install
cmds:
- "docker compose run --rm php composer install"
composer-install-prod:
desc: Composer install --no-dev
cmds:
- "docker compose run --rm php composer install --optimize-autoloader --no-suggest --no-dev"
composer-update:
aliases: [cu]
desc: Composer update
cmds:
- "docker compose run --rm php composer update"
down:
desc: Stop and remove all containers
cmds:
- "docker compose down --remove-orphans"
- cmd: echo "π Containers is stopped and removed"
silent: true
git-pull:
desc: Git pull and reset hard
cmds:
- git reset --hard
- git pull origin
help:
desc: Display this help
cmds:
- echo "{{.GREETING}}"
- task --list
silent: true
larastan:
desc: Larastan code analysis
cmds:
- "docker compose exec php php ./vendor/bin/phpstan analyse"
laravel-artisan:
aliases: [a, artisan]
desc: Laravel Artisan command (If '--' is given, all following parameters are added)
cmds:
- "docker compose exec php php artisan {{.CLI_ARGS}}"
laravel-down:
aliases: [ld]
desc: Laravel down
cmds:
- "docker compose exec php php artisan down"
laravel-ide-helpers:
aliases: [lih]
desc: Laravel IDE helpers
cmds:
- "docker compose exec php php artisan ide-helper:generate"
- "docker compose exec php php artisan ide-helper:meta"
- "docker compose exec php php artisan ide-helper:models --nowrite"
laravel-install:
desc: Install fresh new Laravel
cmds:
- "docker compose run --rm php composer create-project laravel/laravel laravel --prefer-dist"
- mv README.md README-docker.md
- mv -f ./laravel/* ./laravel/.* ./
- rm -rf ./laravel
laravel-key:
desc: Laravel key generate
cmds:
- "docker compose run --rm php php artisan key:generate"
laravel-migrate:
aliases: [lm]
desc: Laravel migrate
cmds:
- "docker compose exec php php artisan migrate"
laravel-migrate-rollback:
aliases: [lmr]
desc: Laravel migrate Rollback
cmds:
- "docker compose exec php php artisan migrate:rollback"
laravel-migrate-force:
aliases: [lmfc]
desc: Laravel migrate --force
cmds:
- "docker compose exec php php artisan migrate --force"
laravel-migrate-fresh:
aliases: [lmf]
desc: Laravel migrate fresh
cmds:
- "docker compose exec php php artisan migrate:fresh"
laravel-migrate-fresh-seed:
aliases: [lmfs]
desc: Laravel migrate fresh --seed
cmds:
- "docker compose exec php php artisan migrate:fresh --seed"
laravel-pint:
aliases: [pint]
desc: Laravel Pint linter (If '--' is given, all following parameters are added)
cmds:
- "docker compose exec php php ./vendor/bin/pint {{.CLI_ARGS}}"
laravel-tinker:
aliases: [tinker]
desc: Laravel Tinker
cmds:
- "docker compose exec php php artisan tinker"
laravel-storage-link:
aliases: [lsl]
desc: Laravel storage link
cmds:
- "docker compose run --rm php php artisan storage:link"
laravel-up:
aliases: [lu]
desc: Laravel up
cmds:
- "docker compose exec php php artisan up"
laravel-test:
aliases: [lt, test]
desc: Laravel test
cmds:
- "docker compose exec php php artisan config:clear"
- "docker compose exec php php artisan test"
laravel-queue-work:
aliases: [lqw]
desc: Laravel queue work
cmds:
- "docker compose exec php php artisan queue:work"
logs:
desc: Show logs of all containers
cmds:
- "docker compose logs"
npm:
desc: NPM command
cmds:
- "docker compose run --rm node npm {{.CLI_ARGS}}"
npm-install:
aliases: [ni]
desc: NPM install
cmds:
- "docker compose run --rm node npm install"
npm-lint:
aliases: [eslint]
desc: Eslint code analysis
cmds:
- "docker compose run --rm node npm run lint"
npm-update:
aliases: [nu]
desc: NPM update
cmds:
- "docker compose run --rm node npm update"
pull:
desc: Pull containers
cmds:
- "docker compose pull"
restart:
aliases: [r]
desc: Restart the projects
cmds:
- task: down
- task: up
setup:
desc: Setup project (composer, npm, migrate, seed)
cmds:
- cmd: echo "π§ Installing..."
silent: true
- cp docker-compose-dev.yml docker-compose.yml
- cp .env.example .env
- touch database/database.sqlite
- task: upgrade
- task: composer-install-dev
- task: npm-install
- task: vite-cert
- task: laravel-key
- task: laravel-storage-link
- cmd: echo "β
Setup is done"
silent: true
- cmd: echo "π¨ Edit .env file and run 'task up' to start containers, and 'task laravel-migrate-fresh-seed' if you want to seed the database"
silent: true
vite-cert:
desc: Generate the Vite certificates
cmds:
- mkdir -p docker/node
- mkcert -cert-file docker/node/localhost.pem -key-file docker/node/localhost-key.pem localhost
- cmd: echo "π Vite certificates are generated!"
silent: true
up:
desc: Create and start all containers
cmds:
- "docker compose up -d"
- cmd: echo "β
Containers is up and running"
silent: true
upgrade:
desc: Upgrade containers (pull and build)
cmds:
- task: pull
- task: build