#!/usr/bin/env bash
#
# Copyright 2020 Confluent Inc.
#
set -o nounset
set -o errexit

export CP_COMPONENT_NAME=ksqldb
export CP_COMPONENT_SCRIPT_DIR=/opt/confluentinc/etc/${CP_COMPONENT_NAME}
export KSQL_CONFIG_DIR=/mnt/config

echo "===> User: $(id)"
export OPERATOR_SCRIPT_DIR=/mnt/config/${CP_COMPONENT_NAME}
echo "===> Loading ${CP_COMPONENT_NAME} operator scripts from path ${OPERATOR_SCRIPT_DIR}/bin"

"${OPERATOR_SCRIPT_DIR}"/bin/configure
exec "${OPERATOR_SCRIPT_DIR}"/bin/launch
