-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
59 lines (43 loc) · 1.3 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
51
52
53
54
55
56
57
58
59
.PHONY: all v build test clean lint cover cover-html docker-image
VERSION := $(shell git describe --tags --always --dirty="-dev")
all: clean build
v:
@echo "Version: ${VERSION}"
run-dev:
go run . -mock-node -log-prod
build:
go build -trimpath -ldflags "-s -X main.version=${VERSION}" -v -o prio-load-balancer main.go
build-tee:
go build -tags tee -trimpath -ldflags "-s -X main.version=${VERSION}" -v -o prio-load-balancer main.go
clean:
rm -rf prio-load-balancer build/
test:
go test ./...
lint:
gofmt -d -s .
gofumpt -d -extra .
go vet ./...
go vet --tags=tee ./...
staticcheck ./...
# golangci-lint run
lt: lint test
lint-strict: lint
gofumpt -d -extra .
golangci-lint run
fmt:
gofmt -s -w .
gofumpt -extra -w .
gci write .
go mod tidy
cover:
go test -coverprofile=/tmp/go-prio-lb.cover.tmp ./...
go tool cover -func /tmp/go-prio-lb.cover.tmp
unlink /tmp/go-prio-lb.cover.tmp
cover-html:
go test -coverprofile=/tmp/go-prio-lb.cover.tmp ./...
go tool cover -html=/tmp/go-prio-lb.cover.tmp
unlink /tmp/go-prio-lb.cover.tmp
docker-image:
DOCKER_BUILDKIT=1 docker build --platform linux/amd64 --build-arg VERSION=${VERSION} . -t prio-load-balancer
docker-image-tee:
DOCKER_BUILDKIT=1 docker build --platform linux/amd64 --build-arg VERSION=${VERSION} . -f Dockerfile.tee -t prio-load-balancer