Add config for CMIS API tests

This commit is contained in:
Alex Mukha
2020-07-08 12:11:35 +01:00
parent 01a60ff74a
commit 16197a5195
13 changed files with 604 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
#!/usr/bin/env bash
set -eux
# Start Alfresco and Solr.
# The location for the docker-compose files.
DOCKER_RESOURCE_FOLDER=$1
# The search docker image.
SEARCH_IMAGE=$2
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
export DOCKER_CLIENT_TIMEOUT=120
export COMPOSE_HTTP_TIMEOUT=120
# Pull the image, to ensure we're not using a stale image from the build agent.
docker pull "$SEARCH_IMAGE"
# Build the images and call docker-compose.
cd "$DOCKER_RESOURCE_FOLDER"
docker-compose up -d --build --force-recreate
$SCRIPT_DIR/wait-service-to-start.sh
+28
View File
@@ -0,0 +1,28 @@
#!/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`
ENDPOINT="${1:-http://localhost:8081/alfresco}"
echo "Waiting for Service to start using endpoint: ${ENDPOINT}"
until $(curl --output /dev/null --silent --head --fail ${ENDPOINT}) || [ "$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