-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathMakefile.nix
55 lines (44 loc) · 1.72 KB
/
Makefile.nix
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
# Usage:
# make -f Makefile.nix [command]
# setup_all # setup all the components
# refresh_all # refresh all the components
# make setup_api # build the Laravel backend
# make refresh_api # refresh the Laravel backend
# make setup_web # build the React frontend
# make refresh_web # refresh the React frontend
# make git_clean # use git to remove all untracked files - DANGER!
# make compose_up # bring up the docker compose network
# make compose_down # bring down the docker compose network
.PHONY: setup_all refresh_all setup_api refresh_api setup_web refresh_web git_clean compose_up compose_down queue_work
setup_all: setup_api setup_web
refresh_all: refresh_api refresh_web
setup_api:
cp api/.env.example api/.env --preserve=all
cd api && composer install --prefer-dist
php api/artisan key:generate
php api/artisan migrate:fresh --seed
php api/artisan lighthouse:print-schema --write
touch api/storage/logs/laravel.log
docker compose exec webserver sh -c "chown -R www-data:www-data /home/site/wwwroot/api/storage"
docker compose exec webserver sh -c "chmod -R a+r,a+w /home/site/wwwroot/api/storage /home/site/wwwroot/api/bootstrap/cache"
php api/artisan optimize:clear
refresh_api:
cd api && composer install --prefer-dist
php api/artisan migrate
php api/artisan lighthouse:print-schema --write
php api/artisan optimize:clear
setup_web:
cp apps/web/.env.example apps/web/.env --preserve=all
pnpm install
pnpm run dev:fresh
refresh_web:
pnpm install
pnpm run dev
git_clean:
sudo git clean -xdf
compose_up:
docker compose up --detach
compose_down:
docker compose down
queue_work:
docker compose exec webserver sh -c "runuser -u www-data -- php /home/site/wwwroot/api/artisan queue:work"