-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
77 lines (52 loc) · 1.43 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
export DB_DIR=./smtpbridge_data
export DB_FILE=smtpbridge.db
export DB_PATH="$(DB_DIR)/$(DB_FILE)"
export DEV_IP=127.0.0.1
-include .env
snapshot:
goreleaser release --snapshot --clean
run:
go run ./cmd/smtpbridge
preview:
cd web && pnpm run build && cd .. && go run ./cmd/smtpbridge
clean:
rm -rf "$(DB_DIR)" && mkdir "$(DB_DIR)"
gen: db-migrate gen-jet gen-templ
tooling: tooling-air tooling-jet tooling-goose tooling-atlas tooling-templ tooling-goreleaser
# Development
dev:
air
dev-web:
cd web && pnpm install && pnpm run dev
# Database
db-ui:
podman run -it --rm \
-p 8090:8080 \
-v "$(DB_DIR):/data" \
-e "SQLITE_DATABASE=$(DB_FILE)" \
docker.io/coleifer/sqlite-web
db-inspect:
atlas schema inspect --env local
db-migration:
atlas migrate diff $(name) --env local
db-migrate:
goose -dir migrations/sql sqlite3 "$(DB_PATH)" up
# Generation
gen-jet:
jet -source=sqlite -dsn="$(DB_PATH)" -path=./internal/jet -ignore-tables goose_db_version,_dummy
rm -rf ./internal/jet/model
gen-templ:
cd web && templ generate
# Tooling
tooling-air:
go install github.com/air-verse/air@latest
tooling-jet:
go install github.com/go-jet/jet/v2/cmd/jet@latest
tooling-goose:
go install github.com/pressly/goose/v3/cmd/goose@latest
tooling-atlas:
go install ariga.io/atlas/cmd/atlas@latest
tooling-templ:
go install github.com/a-h/templ/cmd/templ@latest
tooling-goreleaser:
go install github.com/goreleaser/goreleaser@latest