Change docker entrypoint to allow passing any arguments to the tremor cli.
Default is running server run as before.
#!/bin/sh
set -x
-if [ ! -z ${SLEEP+x} ]
+if [ -n "${SLEEP+x}" ]
then
sleep "$SLEEP"
fi
+
+if [ "$#" != "0" ]
+then
+ ARGS=$*
+else
+
if [ -z ${LOGGER_FILE+x} ]
then
LOGGER_FILE="/etc/tremor/logger.yaml"
fi
-queries=`ls -1 /etc/tremor/config/*.trickle 2>/dev/null | wc -l`
-if [ $queries != 0 ]
+ ARTEFACTS="/etc/tremor/config/*.yaml"
+ QUERIES=$(find /etc/tremor/config/ -name '*.trickle' -print 2>/dev/null | wc -l)
+ if [ "$QUERIES" != 0 ]
then
- exec /tremor server run -f /etc/tremor/config/*.yaml /etc/tremor/config/*.trickle --logger-config "${LOGGER_FILE}"
-else
- exec /tremor server run -f /etc/tremor/config/*.yaml --logger-config "${LOGGER_FILE}"
+ ARTEFACTS="$ARTEFACTS /etc/tremor/config/*.trickle"
+ fi
+ ARGS="server run -f ${ARTEFACTS} --logger-config ${LOGGER_FILE}"
fi
+exec /tremor "${ARGS}"
+
