-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
43 lines (37 loc) · 1.14 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
version: '3'
tasks:
run:low_stock_detector:
desc: Run the low stock detector
cmds:
- target/low_stock_detector
run:stock_event_generator:
desc: Run the stock event generator
cmds:
- target/stock_event_generator
run:stock_updater:
desc: Run the stock updater
cmds:
- target/stock_updater
listen:low_stock:
desc: Listen for low stock events
cmds:
- nats --context=rethink sub "product.>"
setup:
desc: Create the jetStream stream and KV
cmds:
- task build
- nats --context=rethink stream add --subjects "warehouse.*.product.>" --defaults RETHINK_WAREHOUSE
- nats --context=rethink kv add RETHINK_STOCK
teardown:
desc: Remove the jetStream stream and KV
cmds:
- rm -rf target/*
- nats --context=rethink stream rm -f RETHINK_WAREHOUSE
- nats --context=rethink kv rm -f RETHINK_STOCK
build:
desc: Build the executables
cmds:
- go mod tidy
- go build -o target/low_stock_detector ./low_stock_detector
- go build -o target/stock_event_generator ./stock_event_generator
- go build -o target/stock_updater ./stock_updater