-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
63 lines (47 loc) · 1.84 KB
/
Makefile
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
init:
devbox install && \
devbox run initdb && \
sed -i "s/#port = 5432/port = 5434/g" ./.devbox/virtenv/postgresql/data/postgresql.conf && \
sed -i "s/#log_statement = 'none'/log_statement = 'all'/g" ./.devbox/virtenv/postgresql/data/postgresql.conf && \
sed -i "s/#logging_collector = off/logging_collector = on/g" ./.devbox/virtenv/postgresql/data/postgresql.conf && \
sed -i "s/#log_directory = 'log'/log_directory = 'log'/g" ./.devbox/virtenv/postgresql/data/postgresql.conf
create:
devbox run "createdb -p 5434 bemi_dev_source && \
createuser -p 5434 --superuser --replication postgres && \
psql -p 5434 -U postgres -c \"ALTER SYSTEM SET wal_level = logical;\"" && \
make down-services up-services
delete:
devbox run "dropdb -p 5434 bemi_dev_source && dropuser -p 5434 postgres"
install:
devbox run --env-file ./server/.env "bun install && \
cd server && \
bun install && \
bun prisma generate && \
bun prisma generate --schema prisma/bemi.prisma && \
cd ../client && bun install"
up: install
devbox run "bun run concurrently \"make up-server\" \"make up-client\""
up-next: install
devbox run --env-file ./server/.env "cd server && bun next dev ./next-app -p 4003"
up-server:
devbox run --env-file ./server/.env "cd server && bun --inspect src/index.ts"
up-client:
devbox run "cd client && PORT=4002 bun run react-scripts start"
up-postgres:
devbox services up postgresql-source
up-services:
devbox services start postgresql-source
down-services:
devbox services stop
psql:
devbox run psql bemi_dev_source -p 5434
logs:
tail -f .devbox/virtenv/postgresql/data/log/postgresql-*.log
ps:
@devbox services ls
sh:
devbox --env-file ./server/.env shell
migrate:
devbox run --env-file ./server/.env "cd server && bunx prisma migrate dev"
reset:
devbox run --env-file ./server/.env "cd server && bunx prisma migrate reset"