#!/usr/bin/env bash
set -e

# S2I run script for extending the strimzi/kafka-connect image with additional Kafka Connect plugins
# This script is responsible for starting distributed Kafka Connect worker with custom plugins directory

if [ "$1" = "-h" ]
then
  ./usage
  exit 0
fi

export KAFKA_CONNECT_PLUGIN_PATH=/tmp/kafka-plugins
echo "Starting Kafka Connect with custom plugin directory $KAFKA_CONNECT_PLUGIN_PATH"
# shellcheck source=/opt/kafka/kafka_connect_run.sh
# shellcheck disable=SC1091
source /opt/kafka/kafka_connect_run.sh