Files
SearchServices/e2e-test/helpers/wait-service-to-start.sh
Alex Mukha 9c38c27316 SEARCH-2318: Add Travis configuration to Insight Engine (#873)
The changes include the following:
* The python scripts for e2e environment creation were moved to this code base
* Mirror to community
* Docker image check
* Unit, integration and e2e tests
* "Snapshots": "latest" docker image from master in quay.io, docker images for "release" branches to quay.io, "master" and * "release" branches snapshots to nexus
* Releases: nexus, s3 staging bucket, quay.io and dockerhub
* Fix for https://issues.alfresco.com/jira/browse/SEARCH-2389

The build is using branches only.
2021-01-25 12:10:06 +00:00

32 lines
861 B
Bash
Executable File

#!/usr/bin/env bash
set -e # exit if commands fails
set -x # trace what gets exe
WAIT_INTERVAL=1
COUNTER=0
TIMEOUT=2000
t0=`date +%s`
declare -a endpoints=("${1:-http://localhost:8081/alfresco/}" "${1:-http://localhost:8083/solr/}")
for endpoint in "${endpoints[@]}"
do
echo "Waiting for Service to start using endpoint: ${endpoint}"
until [[ "$(curl --output /dev/null -w ''%{http_code}'' --silent --head --fail ${endpoint})" == 200 ]] || [ "$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 "Service ${endpoint} Started in $delta minutes"
else
echo "Service ${endpoint} could not start in time."
echo "Waited $COUNTER seconds"
exit 1
fi
done