-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
137 lines (117 loc) · 3.97 KB
/
Taskfile.yml
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
version: "3"
dotenv:
- .env
- "{{.ENV}}/.env."
- "{{.HOME}}/.env"
vars:
UNMASKED_CUSTOMERS: '"[{\\\"last_name\\\": \\\"Smith\\\",\\\"first_name\\\": \\\"Jane\\\"}]"'
LOG_LEVEL: INFO
env:
REDPANDA_VERSION: latest
REDPANDA_CONSOLE_VERSION: latest
GRAFANA_VERSION: latest
PROMETHEUS_VERSION: latest
ALERT_MANAGER_VERSION: latest
REDPANDA_CONNECT_VERSION: latest
MAILPIT_VERSION: latest
SCHEMA_REGISTRY_URL: http://localhost:18081
REDPANDA_SEED_URL: localhost:19092
tasks:
check:
cmds:
- trunk check -a
tests:
dir: go
cmds:
- rpk profile use test
- go test -v ./pixie79/*
- go test -v ./transform/*/tests/
clean:
cmds:
- task: demo-stop
- rm -rf go/transform/*/*.wasm
- rm -f test-data/*.json
- rm -f bin/*
- rm -f docker/mailpit/data/mailpit.*
build:
dir: go/transform/{{.NAME}}
cmds:
- rpk transform build
list:
cmds:
- rpk transform list
deploy-demo:
deps:
- task: build
vars:
NAME: "{{.NAME}}"
dir: go/transform/{{.NAME}}
cmds:
- echo "Deploying Transform {{ .NAME }}"
- ls
- rpk transform deploy --file {{ .NAME }}.wasm --name {{ .NAME }}
--input-topic {{ .REDPANDA_INPUT_TOPIC }} --output-topic {{ .REDPANDA_OUTPUT_TOPIC }} --var
DESTINATION_SCHEMA_ID={{.DESTINATION_SCHEMA_ID}} --var UNMASKED_CUSTOMERS={{ .UNMASKED_CUSTOMERS }} --var LOG_LEVEL={{ .LOG_LEVEL }}
vars:
NAME: demo
REDPANDA_INPUT_TOPIC: demo
REDPANDA_OUTPUT_TOPIC: output-demo
DESTINATION_SCHEMA_ID:
sh: rpk registry schema get output-demo-value --schema-version latest --format json | jq '.[0].id'
delete:
cmds:
- rpk transform delete {{.NAME}}
demo-start:
cmds:
- task: docker-up
- sleep 10
- rpk profile create demo --from-profile rpk-docker-profile.yml
- rpk profile use demo
- rpk registry schema create demo-value --schema schemas/demo.avsc
- rpk registry schema create output-demo-value --schema schemas/demo.avsc
- rpk topic create __redpanda.connect.logs demo output-demo
- echo "Grafana running on http://localhost:3000"
- echo "Redpanda console running on http://localhost:8080"
- echo "Mailpit running on http://localhost:8025"
- echo "Prometheus running on http://localhost:9090"
- echo "Alertmanager running on http://localhost:9093"
docker-up:
cmds:
- docker-compose up -d --wait
docker-stop:
cmds:
- docker-compose down -v
demo-stop:
cmds:
- docker-compose down -v --remove-orphans
- rpk profile delete demo
create-rpk-test-profile:
cmds:
- rpk profile create test --from-profile rpk-test-profile.yml
transform-logs:
cmds:
- rpk transform logs $NAME -f
env:
NAME: "{{.NAME}}"
generate-test-data:
dir: test-data
cmds:
- ../bin/generate-test-data -t demoEvent -n 1000 -o demoEvent.json
build-test-data-generator:
dir: go
cmds:
- go build -o ../bin/generate-test-data pixie79/generate-test-data
build-test-data-loader:
dir: go
cmds:
- go build -o ../bin/load-test-data pixie79/load-test-data
load-td-demoEvent:
dir: test-data
cmds:
- ../bin/load-test-data -filename demoEvent.json -t demoEvent
env:
REDPANDA_INPUT_TOPIC: demo
DESTINATION_SCHEMA_ID:
sh:
rpk registry schema get output-demo-value --schema-version latest --format
json | jq '.[0].id'