-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
46 lines (32 loc) · 1021 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
.PHONY: install-go-test-coverage
install-go-test-coverage:
go install github.com/vladopajic/go-test-coverage/v2@latest
.PHONY: check-coverage
check-coverage: install-go-test-coverage
CGO_ENABLED=1 GOEXPERIMENT=loopvar go test -race -coverprofile=./cover.out -covermode=atomic ./...
PROJECT_PREFIX_1=capricornusx/bloom-du/
PROJECT_PREFIX_2=bloom-du/
DOCKER_IMAGE=capricornusx/bloom-du
all: test build
vet:
go vet ./...
test: format tidy vet
CGO_ENABLED=1 GOEXPERIMENT=loopvar go test -race ./...
check: format #govulncheck gosec
gocritic:
gocritic check --disable=commentFormatting ./...
govulncheck:
govulncheck ./...
gosec:
gosec -exclude=G505 ./...
format: gci
gofmt -w .
gci:
gci write -s standard -s default -s "prefix(${PROJECT_PREFIX_1})" -s "prefix(${PROJECT_PREFIX_2})" -s blank -s dot .
tidy:
go mod tidy
build: format tidy
CGO_ENABLED=0 GOOS="linux" GOARCH="amd64" go build -o ./bloom-du
build-docker: build
docker build -t ${DOCKER_IMAGE} -f Dockerfile .
docker push ${DOCKER_IMAGE}