-
Notifications
You must be signed in to change notification settings - Fork 165
/
Makefile
35 lines (29 loc) · 1.12 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
.PHONY: init
init:
go install github.com/google/wire/cmd/wire@latest
go install github.com/golang/mock/mockgen@latest
go install github.com/swaggo/swag/cmd/swag@latest
.PHONY: bootstrap
bootstrap:
cd ./deploy/docker-compose && docker compose up -d && cd ../../
go run ./cmd/migration
nunu run ./cmd/server
.PHONY: mock
mock:
mockgen -source=internal/service/user.go -destination test/mocks/service/user.go
mockgen -source=internal/repository/user.go -destination test/mocks/repository/user.go
mockgen -source=internal/repository/repository.go -destination test/mocks/repository/repository.go
.PHONY: test
test:
go test -coverpkg=./internal/handler,./internal/service,./internal/repository -coverprofile=./coverage.out ./test/server/...
go tool cover -html=./coverage.out -o coverage.html
.PHONY: build
build:
go build -ldflags="-s -w" -o ./bin/server ./cmd/server
.PHONY: docker
docker:
docker build -f deploy/build/Dockerfile --build-arg APP_RELATIVE_PATH=./cmd/task -t 1.1.1.1:5000/demo-task:v1 .
docker run --rm -i 1.1.1.1:5000/demo-task:v1
.PHONY: swag
swag:
swag init -g cmd/server/main.go -o ./docs --parseDependency