-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
47 lines (32 loc) · 943 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
PROJECT_NAME=vbalancer
.PHONY: all dep build test lint mocks
all: lint test race build
pre-push: lint test race
prepare:
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
go install github.com/golang/mock/[email protected]
mocks:
mockgen -destination=mocks/mock_peer.go -package=mocks -source=./internal/proxy/peer/peer.go Peer
mockgen -destination=mocks/mock_vlog.go -package=mocks -source=./internal/vlog/vlog.go ILog
init:
go mod tidy
go mod vendor
fmt:
go fmt ./...
lint:
go vet ./...
golangci-lint run -v ./...
test:
go test -v ./...
race:
go test -race -v ./...
build:
go build -o build/$(PROJECT_NAME) cmd/$(PROJECT_NAME)/$(PROJECT_NAME).go
build-win:
go build -o build/$(PROJECT_NAME).exe cmd/$(PROJECT_NAME)/$(PROJECT_NAME).go
docker-create:
docker build --tag vbalancer . -f Dockerfile
docker-run:
docker run --restart=always -p 8080:8080 vbalancer
docker-delete:
docker rmi vbalancer