- use kxs-ts-gen for TypeScript schemas
- update schema files, so they're tidier (no need for typescript-generator workarounds)
- version bumps (kotlin, gradle, tstl, factorio, kotest)
- improve kxs binary format (use okio)
- move schema files package ('events' wasn't needed)
- tidy up topic creation, naming. base it off classes, make util functions
29 lines
713 B
Bash
29 lines
713 B
Bash
#!/usr/bin/bash
|
|
|
|
# Pipe Docker logs from a Factorio server to a Kafka topic
|
|
|
|
echo "Kafkatorio-Pipe version $KAFKATORIO_VERSION"
|
|
echo "Piping logs from $FACTORIO_SERVER_CONTAINER_NAME to $KAFKA_HOST"
|
|
|
|
trap endProcess SIGINT
|
|
endProcess() {
|
|
echo "Exiting Factorio Events Kafka Pipe"
|
|
exit
|
|
}
|
|
|
|
# some random ID, to use as a message key
|
|
INSTANCE_ID=$(cat /proc/sys/kernel/random/uuid)
|
|
|
|
while :; do
|
|
docker logs --tail 0 -f "$FACTORIO_SERVER_CONTAINER_NAME" |
|
|
sed -n -e 's/^KafkatorioPacket: //p' |
|
|
kcat -P -T \
|
|
-b "$KAFKA_HOST" \
|
|
-t kafkatorio.src.server-log \
|
|
-k "$INSTANCE_ID" \
|
|
-H "KAFKA-PIPE-VERSION=$KAFKATORIO_VERSION"
|
|
|
|
echo "Error - retrying in 10 seconds"
|
|
sleep 10
|
|
|
|
done
|