-
Notifications
You must be signed in to change notification settings - Fork 71
/
Makefile
30 lines (25 loc) · 866 Bytes
/
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
.PHONY: init
init:
go install github.com/google/wire/cmd/wire@latest
go install github.com/swaggo/swag/cmd/swag@latest
go install github.com/incu6us/goimports-reviser/v3@latest
go install mvdan.cc/gofumpt@latest
.PHONY: build
build:
go build -ldflags="-s -w" -o ./bin/server ./cmd/server
.PHONY: docker
docker:
docker build -t webstack-go:v2 --build-arg APP_CONF=config/prod.yml --build-arg APP_RELATIVE_PATH=./cmd/server .
docker run -itd -p 8000:8000 --name webstack-go webstack-go:v2
.PHONY: swag
swag:
swag init -g cmd/server/main.go -o ./docs --parseDependency
.PHONY: fmt
fmt:
goimports-reviser -rm-unused -set-alias -format ./...
find . -name '*.go' -not -name "*.pb.go" -not -name "*.gen.go" | xargs gofumpt -w -extra
.PHONY: run
run:
go mod tidy
go build -ldflags="-s -w" -o ./bin/server ./cmd/server
./bin/server -conf=config/prod.yml