This repository has been archived by the owner on Mar 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile
73 lines (56 loc) · 1.58 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Image URL to use all building/pushing image targets
TAG ?= latest
IMG ?= vmware/kafka-slo-exporter
CGO_ENABLED ?= 0
EXTRA_GO_LDFLAGS ?= ""
BUILDARCH ?= amd64
GO_LDFLAGS := -s -w $(EXTRA_GO_LDFLAGS)
.PHONY: fmt
fmt: ## Run go fmt against code.
go fmt ./...
.PHONY: test
test: ## Run go test against code.
go test ./... -timeout 300s -count=1 -v
.PHONY: test-ci
test-ci: ## Run go test against code.
go test --tags=ci ./... -count=1 -v
.PHONY: teste2e
teste2e: ## Run go test against code.
go test ./e2e/tests -timeout 300s -count=1 -v
.PHONY: vet
vet: ## Run go vet against code.
go vet ./...
.PHONY: tidy
tidy: ## Run go mod tidy
go mod tidy
.PHONY: vendor
vendor: go.mod go.sum
go mod vendor
##@ Build
.PHONY: build
build: tidy fmt vet ## Build manager binary.
go build -o bin/kafka-slo-monitoring
.PHONY: run-consumer
run-consumer: fmt vet
go run main.go consumer
.PHONY: run-producer
run-producer: fmt vet
go run main.go producer
.PHONY: run-app
run-app: fmt vet
go run main.go app
.PHONY: build-image
build-image: vendor ## Build docker image with the manager.
docker build -t ${IMG}:${TAG} $(DOCKER_BUILD_ARGS) .
.PHONY: push-image
push-image: build-image ## Push docker image with the manager.
docker push ${IMG}:${TAG}
docker push ${IMG}:latest
.PHONY: start-environ
start-environ:
docker-compose -f compose.yaml up
.PHONY: godoc
godoc: ## Use gomarkdoc to generate documentation for the whole project
gomarkdoc --output 'docs/{{.Dir}}/README.md' ./cmd/...
gomarkdoc --output 'docs/{{.Dir}}/README.md' ./config/...
gomarkdoc --output 'docs/{{.Dir}}/README.md' ./pkg/...