Skip to content

Commit

Permalink
wait-for-it_several_databases
Browse files Browse the repository at this point in the history
  • Loading branch information
nesies authored and nesies committed Jul 27, 2023
1 parent 3f9c9a4 commit bfc8f25
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 3 deletions.
15 changes: 14 additions & 1 deletion camunda-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,20 @@ fi
CMD="/camunda/internal/run.sh start"

if [ -n "${WAIT_FOR}" ]; then
CMD="wait-for-it.sh ${WAIT_FOR} -s -t ${WAIT_FOR_TIMEOUT} -- ${CMD}"
found=0
for tmp in $(echo "${WAIT_FOR}" | tr ',' '\n'); do
if wait-for-it.sh "$tmp" -s -t ${WAIT_FOR_TIMEOUT} ; then
echo "$tmp up"
found=1
break
else
echo "$tmp down"
fi
done
if [ "$found" -eq 0 ] ; then
echo "nothing up in WAIT_FOR=$WAIT_FOR"
exit 1
fi
fi

# shellcheck disable=SC2086
Expand Down
15 changes: 14 additions & 1 deletion camunda-tomcat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,20 @@ fi
CMD+=" run"

if [ -n "${WAIT_FOR}" ]; then
CMD="wait-for-it.sh ${WAIT_FOR} -s -t ${WAIT_FOR_TIMEOUT} -- ${CMD}"
found=0
for tmp in $(echo "${WAIT_FOR}" | tr ',' '\n'); do
if wait-for-it.sh "$tmp" -s -t ${WAIT_FOR_TIMEOUT} ; then
echo "$tmp up"
found=1
break
else
echo "$tmp down"
fi
done
if [ "$found" -eq 0 ] ; then
echo "nothing up in WAIT_FOR=$WAIT_FOR"
exit 1
fi
fi

# shellcheck disable=SC2086
Expand Down
15 changes: 14 additions & 1 deletion camunda-wildfly.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,20 @@ if [ "$JMX_PROMETHEUS" = "true" ] ; then
fi

if [ -n "${WAIT_FOR}" ]; then
CMD="wait-for-it.sh ${WAIT_FOR} -s -t ${WAIT_FOR_TIMEOUT} -- ${CMD}"
found=0
for tmp in $(echo "${WAIT_FOR}" | tr ',' '\n'); do
if wait-for-it.sh "$tmp" -s -t ${WAIT_FOR_TIMEOUT} ; then
echo "$tmp up"
found=1
break
else
echo "$tmp down"
fi
done
if [ "$found" -eq 0 ] ; then
echo "nothing up in WAIT_FOR=$WAIT_FOR"
exit 1
fi
fi

# shellcheck disable=SC2086
Expand Down

0 comments on commit bfc8f25

Please sign in to comment.