forked from ess-dmsc/kafka-to-nexus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker_launch.sh
executable file
·43 lines (37 loc) · 1.1 KB
/
docker_launch.sh
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
#!/usr/bin/env bash
# Wait for Kafka broker to be up
kafkacat -b ${KAFKA_BROKER:="localhost"} -L
OUT=$?
i="0"
while [ $OUT -ne 0 -a $i -ne 5 ]; do
echo "Waiting for Kafka to be ready"
sleep 10
kafkacat -b ${KAFKA_BROKER:="localhost"} -L
OUT=$?
let i=$i+1
echo $i
done
if [ $i -eq 5 ]
then
echo "Kafka broker not accessible at file writer launch"
exit 1
fi
export LD_LIBRARY_PATH=/home/jenkins/build/lib/
COMMAND_URI="${COMMAND_URI:=//localhost:9092/TEST_writerCommand}"
STATUS_URI="${STATUS_URI:=//localhost:9092/TEST_writerStatus}"
GRAYLOG_ADDRESS="${GRAYLOG_ADDRESS:=localhost:12201}"
HDF_OUTPUT_PREFIX="${HDF_OUTPUT_PREFIX:=/output-files/}"
if [ -z "$CONFIG_FILE" ]
then
COMMAND=/home/jenkins/build/bin/kafka-to-nexus\ --command-uri\ "${COMMAND_URI}"\ \
--status-uri\ "${STATUS_URI}"\ \
--graylog-logger-address\ "${GRAYLOG_ADDRESS}"\ \
--hdf-output-prefix\ "${HDF_OUTPUT_PREFIX}"\ \
-v\ "${LOG_LEVEL:=3}"
echo $COMMAND
$COMMAND
else
COMMAND=/home/jenkins/build/bin/kafka-to-nexus\ --config-file\ "${CONFIG_FILE}"
echo $COMMAND
$COMMAND
fi