-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
44 lines (36 loc) · 1.31 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
VERSION=$(shell git describe --tags --dirty --always)
.PHONY: build
build:
go build -ldflags "-X 'github.com/conduitio/conduit-connector-kafka.version=${VERSION}'" -o conduit-connector-kafka cmd/connector/main.go
.PHONY: test-kafka
test-kafka:
# run required docker containers, execute integration tests, stop containers after tests
docker compose -f test/docker-compose-kafka.yml up --quiet-pull -d --wait
go test $(GOTEST_FLAGS) -race ./...; ret=$$?; \
docker compose -f test/docker-compose-kafka.yml down; \
exit $$ret
.PHONY: test-redpanda
test-redpanda:
# run required docker containers, execute integration tests, stop containers after tests
docker compose -f test/docker-compose-redpanda.yml up --quiet-pull -d --wait
go test $(GOTEST_FLAGS) -race ./...; ret=$$?; \
docker compose -f test/docker-compose-redpanda.yml down; \
exit $$ret
.PHONY: test
test: test-kafka test-redpanda
.PHONY: generate
generate:
go generate ./...
conn-sdk-cli readmegen -w
.PHONY: fmt
fmt: ## Format Go files using gofumpt and gci.
gofumpt -l -w .
gci write --skip-generated .
.PHONY: lint
lint:
golangci-lint run
.PHONY: install-tools
install-tools:
@echo Installing tools from tools.go
@go list -e -f '{{ join .Imports "\n" }}' tools.go | xargs -I % go list -f "%@{{.Module.Version}}" % | xargs -tI % go install %
@go mod tidy