-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (29 loc) · 1.23 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
default: all
all: clean build
test:
go test ./...
build: clean
mkdir -p out
go build -o out/optprov cmd/optprov/main.go
build-linux:
GOOS=linux GOARCH=amd64 go build -o out/optprov_linux_amd64 cmd/optprov/*
format:
gofumpt -w -l .
clean:
rm -r dist || true
tools:
go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/[email protected]
go install github.com/volatiletech/sqlboiler/[email protected]
go install github.com/volatiletech/sqlboiler/v4/drivers/[email protected]
db-reset: migrate-down migrate-up models
models:
sqlboiler psql
make open-api:
oapi-codegen -generate types -package types ./pkg/api/openapi.yaml > ./pkg/api/types/types.gen.go
openapi-generator generate -g typescript-fetch -i ./pkg/api/openapi.yaml -o ./frontend/src/api --global-property models --additional-properties=supportsES6=true,typescriptThreePlus=true
database:
docker run --rm -p 5433:5432 -e POSTGRES_PASSWORD=password -e POSTGRES_USER=optprov -e POSTGRES_DB=optprov_dev postgres:13
migrate-up:
migrate -database 'postgres://optprov:password@localhost:5433/optprov_dev?sslmode=disable' -path migrations up
migrate-down:
migrate -database 'postgres://optprov:password@localhost:5432/optprov_dev?sslmode=disable' -path migrations down