-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
63 lines (49 loc) · 1.26 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
DOCKER_COMPOSE := docker compose -f compose.local.yaml
all: down build reset up
reset:
echo "UPDATE games SET state = 'waiting', started_at = NULL WHERE game_id = 1;" | make psql-query
.PHONY: build
build:
${DOCKER_COMPOSE} build
cd frontend; npm install
.PHONY: up
up:
${DOCKER_COMPOSE} up -d
cd frontend; npm run dev
.PHONY: down
down:
${DOCKER_COMPOSE} down --remove-orphans
.PHONY: logs
logs:
${DOCKER_COMPOSE} logs
.PHONY: logsf
logsf:
${DOCKER_COMPOSE} logs -f
.PHONY: psql
psql:
${DOCKER_COMPOSE} up --wait db
${DOCKER_COMPOSE} exec db psql --user=postgres albatross
.PHONY: psql-query
psql-query:
${DOCKER_COMPOSE} up --wait db
${DOCKER_COMPOSE} exec --no-TTY db psql --user=postgres albatross
.PHONY: sqldef-dryrun
sqldef-dryrun: down
${DOCKER_COMPOSE} build db
${DOCKER_COMPOSE} up --wait db
${DOCKER_COMPOSE} run --no-TTY tools psqldef --dry-run < ./backend/schema.sql
.PHONY: sqldef
sqldef: down
${DOCKER_COMPOSE} build db
${DOCKER_COMPOSE} up --wait db
${DOCKER_COMPOSE} run --no-TTY tools psqldef < ./backend/schema.sql
.PHONY: init
init: build initdb
.PHONY: initdb
initdb:
make psql-query < ./backend/schema.sql
make psql-query < ./backend/fixtures/dev.sql
.PHONY: gen
gen:
cd backend; make gen
cd frontend; npm run openapi-typescript