created scripts used to start/stop alfresco

This commit is contained in:
cagache
2018-06-28 14:21:22 +03:00
parent e2a57c151f
commit 90c22c66f5
3 changed files with 52 additions and 0 deletions

31
scripts/startAlfresco.sh Normal file
View File

@@ -0,0 +1,31 @@
#!/bin/bash
set -e # exit if commands fails
set -x # trace what gets exe
docker info
docker-compose --version
echo "Starting Alfresco with AGS amps applied in Docker container"
docker-compose ps
docker-compose up -d
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