-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
58 lines (49 loc) · 1.27 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
define JSON_TODO_QUARKUS
curl -X 'POST' \
'http://localhost:8080/todo' \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{
"description": "string",
"done": true,
"dueDate": {
"due": "2021-05-07",
"start": "2021-05-07"
},
"title": "string"
}'
endef
export JSON_TODO_QUARKUS
define TODO_KAFKA
echo 'test%{
"description": "string",
"done": false,
"dueDate": {
"due": "2022-05-08",
"start": "2022-05-07"
},
"title": "string"
}' | kafkacat -t todo_in -b localhost:$(RPK_PORT) -P -K%
endef
export TODO_KAFKA
# Docker
.PHONY: docker
docker:
docker-compose -f src/main/docker/docker-compose.yml -p pipesfilters up
# Tools
todo-quarkus:
@echo $$JSON_TODO_QUARKUS | bash
list:
@curl -X 'GET' 'http://localhost:8080/todo' -H 'accept: */*' | jq .
# RPK
rpk-port:
$(eval RPK_PORT := $(shell docker inspect --format='{{(index (index .NetworkSettings.Ports "9092/tcp") 0).HostPort}}' $(shell docker ps --format "{{.ID}}" --filter="ancestor=vectorized/redpanda:v21.9.5")))
# Kafkacat
kat-send: rpk-port
@echo $$TODO_KAFKA | bash
kat-listen-in: rpk-port
kafkacat -t todo_in -b localhost:$(RPK_PORT) -C
kat-listen-out: rpk-port
kafkacat -t todo_out -b localhost:$(RPK_PORT) -C
kat-test: rpk-port
kafkacat -t todo_in -b localhost:$(RPK_PORT) -P