forked from ricardo-ch/go-kafka-connect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (35 loc) · 1.24 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
MOCKERY_PATH := $(shell [ -z "$${GOBIN}" ] && echo $${GOPATH}/bin/mockery || echo $${GOBIN}/mockery; )
GO_TEST = go test -race -cover -json -v ./...
TEST_OUTPUT = | tparse --all --notests --follow
.PHONY: install
install:
go install github.com/vektra/mockery/v2@latest
go install github.com/mfridman/tparse@latest
.PHONY: build
build:
CGO_ENABLED=0 go build -o ./bin/kc-cli -ldflags '-s' ./cmd/kc-cli
.PHONY: build-all
build-all:
GOOS=linux CGO_ENABLED=0 go build -o ./bin/kc-cli -ldflags '-s' ./cmd/kc-cli
GOOS=darwin CGO_ENABLED=0 go build -o ./bin/kc-cli_mac -ldflags '-s' ./cmd/kc-cli
GOOS=windows CGO_ENABLED=0 go build -o ./bin/kc-cli.exe -ldflags '-s' ./cmd/kc-cli
.PHONY: test
test:
$(GO_TEST) $(TEST_OUTPUT)
.PHONY: test-integration
test-integration: up
$(GO_TEST) -tags=integration -count=1 $(TEST_OUTPUT)
.PHONY: up
up:
docker-compose up -d
@until $$(curl --output /dev/null --silent --head --fail http://localhost:8083); do \
printf '.'; \
sleep 2; \
done
@echo "up and running"
.PHONY: down
down:
docker-compose down
.PHONY: update-mocks
update-mocks:
$(MOCKERY_PATH) --inpackage --case "underscore" --recursive --all --note "NOTE: run 'make update-mocks' from this project top folder to update this file and generate new ones."