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
binary := "lethe"
version := `git describe --tags 2>/dev/null || echo dev`
default:
@just --list
build:
CGO_ENABLED=0 go build -ldflags "-X main.version={{version}}" -o {{binary}} ./cmd/lethe
run:
go run ./cmd/lethe -config config.yaml
air:
air
test:
go test -race ./...
lint:
golangci-lint run --fix ./...
fmt:
gofmt -w .
goimports -w .
tidy:
go mod tidy
# Migration helpers. Requires the `migrate` CLI from golang-migrate/v4 to be
# on PATH. Install on macOS via: brew install golang-migrate
# (see https://github.com/golang-migrate/migrate/tree/master/cmd/migrate).
migrate-up:
migrate -path internal/platform/database/migrations -database "sqlite://./lethe.db" up
migrate-down:
migrate -path internal/platform/database/migrations -database "sqlite://./lethe.db" down 1
migrate-create NAME:
migrate create -ext sql -dir internal/platform/database/migrations -seq {{NAME}}
docker-build:
docker build -t {{binary}}:{{version}} .
docker-up:
docker compose up -d
docker-down:
docker compose down