forked from DataDog/kafka-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
36 lines (28 loc) · 1.05 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
EXECUTABLES = docker go
K := $(foreach exec,$(EXECUTABLES),\
$(if $(shell which $(exec)),some string,$(error "$(exec) not found in PATH")))
# Run a Docker compose environment.
run-compose: compose-build
docker-compose up -d --scale kakfa=3
# Tear down the Docker compose environment.
stop-compose:
docker-compose down
kill-compose:
docker-compose kill
# Ensure any local images used by compose are up to date.
compose-build:
docker-compose build
# Build the Kafka-Kit image.
build-image:
docker buildx build --load --platform linux/amd64 -t kafka-kit -f Dockerfile .
# Run unit tests.
test:
go test -v ./...
# Run all tests.
integration-test: kill-compose stop-compose compose-build run-compose
docker-compose run --rm --name integration-test registry go test -timeout 30s --tags integration ./...
# Generate proto code outputs.
generate-code: build-image
docker create --name kafka-kit kafka-kit >/dev/null; \
docker cp kafka-kit:/go/src/github.com/DataDog/kafka-kit/registry/registry/. ${CURDIR}/registry/registry; \
docker rm kafka-kit >/dev/null