result=$(docker inspect --format '{{.State.Running}}' $CONTAINER_NAME)
if [ $result != "true" ] ; then
+ docker logs $CONTAINER_NAME
echo "$SCRIPT_NAME $(current_timestamp) ERROR: $CONTAINER_NAME container is not running"
exit 1
fi
exit 1
fi
- PORT=$(docker port $CONTAINER_NAME | cut -c1-$(docker port $CONTAINER_NAME | grep -aob '/' | grep -oE '[0-9]+'))
+PORT=$((docker port $CONTAINER_NAME | cut -c1-$(docker port $CONTAINER_NAME | grep -aob '/' | grep -oE '[0-9]+' | sed 1q)) | sed 1q)
+
if [ $? -ne 0 ] || [ -z $PORT ] ; then
echo "$SCRIPT_NAME $(current_timestamp) ERROR: Unable to find PORT using project name: $PROJECT_NAME and container name: $CONTAINER_NAME"
$WAIT_FOR_SCRIPT -t "$TIME_OUT" -h "$HOST_IP" -p "$PORT"
if [ $? -ne 0 ]; then
+ docker logs $CONTAINER_NAME
echo "$SCRIPT_NAME $(current_timestamp) ERROR: wait-for.sh failed ..."
exit 1
fi