drone/wait-for-gitness.sh
Enver Bisevac f58ceac474 [MAINT] initial work on local dev env (#13)
* initial work on local dev env

* minor changes on makefile

* pre-commit x permission added

* readme updated and minor improvments in docker conf
2022-09-12 19:09:04 +02:00

16 lines
334 B
Bash

#!/bin/bash
set -eux
declare -r HOST="localhost:3000/health"
wait-for-url() {
echo "Testing $1"
timeout -s TERM 180 bash -c \
'while [[ "$(curl -s -o /dev/null -L -w ''%{http_code}'' ${0})" != "200" ]];\
do echo "Waiting for ${0}" && sleep 2;\
done' ${1}
echo "OK!"
curl $1
}
wait-for-url http://${HOST}