From ff44bab792386b02b372fd6612d6c95a1a74cac8 Mon Sep 17 00:00:00 2001 From: Martin Stockhammer Date: Tue, 3 Apr 2018 20:33:49 +0200 Subject: [PATCH] Adding additional output for docker script --- src/ci/scripts/container_webtest.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) mode change 100644 => 100755 src/ci/scripts/container_webtest.sh diff --git a/src/ci/scripts/container_webtest.sh b/src/ci/scripts/container_webtest.sh old mode 100644 new mode 100755 index b80845598..90dbc45be --- a/src/ci/scripts/container_webtest.sh +++ b/src/ci/scripts/container_webtest.sh @@ -61,6 +61,7 @@ function stop_instance() { function start_instance() { echo "Starting container ${INSTANCE_NAME}" + echo "ARGS: -d -e SCREEN_WIDTH=${SCREEN_WIDTH} -e SCREEN_HEIGHT=${SCREEN_HEIGHT} --net=${NETWORK_TYPE} -p ${PORT_MAPPING} --name ${INSTANCE_NAME} ${TAG}" docker run -d -e "SCREEN_WIDTH=${SCREEN_WIDTH}" -e "SCREEN_HEIGHT=${SCREEN_HEIGHT}" --net="${NETWORK_TYPE}" -p "${PORT_MAPPING}" --name "${INSTANCE_NAME}" "${TAG}" } @@ -90,7 +91,21 @@ if [ "${START_ARG}" == "start" ]; then stop_instance # Starting start_instance + if [ $? -ne 0 ]; then + echo "Error from docker run" + fi + docker ps + TIMEOUT=20 + RES=1 + while [ $RES -gt 0 -a $TIMEOUT -gt 0 ]; do + sleep 0.2 + TIMEOUT=$((TIMEOUT-1)) + docker logs "${INSTANCE_NAME}" | tail -5 | grep -q "Selenium Server is up and running" + RES=$? + done + docker logs "${INSTANCE_NAME}" elif [ "${START_ARG}" == "stop" ]; then + docker logs "${INSTANCE_NAME}" stop_instance else print_usage -- 2.39.5