diff --git a/scripts/start-compose.sh b/scripts/start-compose.sh old mode 100644 new mode 100755 index 9cc5bc5f78..c852466f04 --- a/scripts/start-compose.sh +++ b/scripts/start-compose.sh @@ -8,9 +8,8 @@ if [ -z "$DOCKER_COMPOSE_PATH" ] ; then fi # Fix uppercase bucket name if set -if [ -n "${S3_BUCKET_NAME}" ] ; then - export S3_BUCKET_NAME="${S3_BUCKET_NAME,,}" -fi +#export S3_BUCKET_NAME="${S3_BUCKET_NAME,,}" +#export S3_BUCKET2_NAME="${S3_BUCKET2_NAME,,}" echo "Starting AGS stack in ${DOCKER_COMPOSE_PATH}" @@ -22,26 +21,4 @@ if [ $? -eq 0 ] ; then else echo "Docker Compose failed to start" >&2 exit 1 -fi - -WAIT_INTERVAL=1 -COUNTER=0 -TIMEOUT=300 -t0=$(date +%s) - -echo "Waiting for alfresco to start" -until $(curl --output /dev/null --silent --head --fail http://localhost:8080/alfresco) || [ "$COUNTER" -eq "$TIMEOUT" ]; do - printf '.' - sleep ${WAIT_INTERVAL} - COUNTER=$(($COUNTER+$WAIT_INTERVAL)) -done - -if (("$COUNTER" < "$TIMEOUT")) ; then - t1=$(date +%s) - delta=$(( ($t1 - $t0)/60 )) - echo "Alfresco Started in $delta minutes" -else - echo "Waited ${COUNTER} seconds" - echo "Alfresco Could not start in time." - exit 1 -fi +fi \ No newline at end of file diff --git a/scripts/waitForAlfrescoToStart.sh b/scripts/waitForAlfrescoToStart.sh index 59c7e40733..9cc8b0fea6 100755 --- a/scripts/waitForAlfrescoToStart.sh +++ b/scripts/waitForAlfrescoToStart.sh @@ -1,23 +1,31 @@ #!/usr/bin/env bash +export ALFRESCO_URL="http://localhost:8080/alfresco" + WAIT_INTERVAL=1 COUNTER=0 TIMEOUT=300 -t0=`date +%s` +t0=$(date +%s) echo "Waiting for alfresco to start" -until $(curl --output /dev/null --silent --head --fail http://localhost:8080/alfresco) || [ "$COUNTER" -eq "$TIMEOUT" ]; do +until $(curl --output /dev/null --silent --head --fail ${ALFRESCO_URL}) || [ "$COUNTER" -eq "$TIMEOUT" ]; do printf '.' sleep $WAIT_INTERVAL COUNTER=$(($COUNTER+$WAIT_INTERVAL)) done if (("$COUNTER" < "$TIMEOUT")) ; then - t1=`date +%s` + t1=$(date +%s) delta=$((($t1 - $t0)/60)) echo "Alfresco Started in $delta minutes" else echo "Waited $COUNTER seconds" echo "Alfresco Could not start in time." + echo "All started containers:" + docker ps -a + ALFCONTAINER=$(docker ps -a | grep _alfresco_1 | awk '{ print $1 }') + echo "Last 200 lines from alfresco.log on container $ALFCONTAINER:" + docker logs --tail=200 ${ALFCONTAINER} exit 1 -fi \ No newline at end of file +fi +