-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (41 loc) · 1.45 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
# Makefile.common
BASE_DIR := $(shell pwd)
.PHONY: check_requirements
check_requirements:
./scripts/check_requirements.sh
.PHONY: gen
gen: gen-codes gen-docs go-codetest
.PHONY: gen-codes
gen-codes:
oapi-codegen -package v1 -generate types,chi-server,spec api/oapi/v1/v1.yaml > api/oapi/v1/v1.oapi.go
buf build -o -#format=json | jq '.file[] | .package' | sort | uniq | head
buf generate
go generate ./internal/storage/servicedb/ent
go generate ./internal/domain/repository/...
go generate ./internal/adapter/...
.PHONY: gen-docs
gen-docs:
# source code dependency graph // source code visualization utility
godepgraph -s -o github.com/sundaytycoon/buttons-api \
-novendor \
-ignoreprefixes github.com/sundaytycoon/buttons-api/internal/storage/servicedb/ent \
-ignorepackages \
github.com/sundaytycoon/buttons-api\
,github.com/sundaytycoon/buttons-api/internal/utils/er\
,github.com/sundaytycoon/buttons-api/internal/utils/retry\
,github.com/sundaytycoon/buttons-api/internal/utils/unittestdocker\
,github.com/sundaytycoon/buttons-api/internal/utils/recovery\
github.com/sundaytycoon/buttons-api/cmd/http_server \
| dot -Tpng -o doc/_images/godepgraph.png
.PHONY: test
test: go-codetest
.PHONY: go-codetest
go-codetest:
# buf breaking --against 'https://github.com/sundaytycoon/buttons-api.git#branch=main'
# buf lint
go fmt ./...
go vet ./...
go test ./...
.PHONY: docker-up
docker-up:
docker-compose -f docker-compose.yml up --build --remove-orphans -d