Commit 94f80599 authored by Yuci Gou's avatar Yuci Gou

Wait until xPub server is up running

parent 643e9b7f
Pipeline #11942 passed with stages
in 5 minutes and 31 seconds
......@@ -5,10 +5,9 @@ cmd="pm2 start pm2.pubsweet.config.js"
$cmd &
echo "Wait up to 3 minutes for server to respond, check every 20 seconds"
COUNTER=0
while [ $COUNTER -lt 15 ]; do
echo "Wait forever for server to respond, check every 20 seconds"
while true
do
RUNNING=$(curl --silent --connect-timeout 20 "http://localhost:$PORT" | grep "/assets/")
if [ -n "$RUNNING" ] ; then
echo "xPub is running"
......@@ -16,14 +15,13 @@ while [ $COUNTER -lt 15 ]; do
#node scripts/adduser.js rakeshnambiar rakeshnbr@ebi.ac.uk Password_01 false
echo "Running post_init.sh script"
./post_init.sh
tail -f /dev/null
echo "Finished running post_init.sh"
break
fi
echo "Waiting for xPub..."
sleep 20
let COUNTER=COUNTER+1
done
echo "ERROR: xPub is not running"
echo "Finished init."
tail -f /dev/null
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment