2022-06-22 14:38:33 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
healthy=true
|
|
|
|
|
2022-07-19 15:39:52 +02:00
|
|
|
if [ -f "/data/.env" ]; then
|
|
|
|
export $(cat /data/.env | xargs)
|
2022-08-16 16:08:00 +02:00
|
|
|
elif [ -f "/home/.env" ]; then
|
|
|
|
export $(cat /home/.env | xargs)
|
|
|
|
else
|
|
|
|
echo "No .env file found"
|
|
|
|
healthy=false
|
2022-07-19 15:39:52 +02:00
|
|
|
fi
|
|
|
|
|
2022-06-22 14:38:33 +02:00
|
|
|
if [[ $(curl -Lfk -s -w "%{http_code}\n" http://localhost/ -o /dev/null) -ne 200 ]]; then
|
|
|
|
echo 'ERROR: Budibase is not running';
|
|
|
|
healthy=false
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ $(curl -s -w "%{http_code}\n" http://localhost:4001/health -o /dev/null) -ne 200 ]]; then
|
|
|
|
echo 'ERROR: Budibase backend is not running';
|
|
|
|
healthy=false
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ $(curl -s -w "%{http_code}\n" http://localhost:4002/health -o /dev/null) -ne 200 ]]; then
|
|
|
|
echo 'ERROR: Budibase worker is not running';
|
|
|
|
healthy=false
|
|
|
|
fi
|
|
|
|
|
2023-11-22 12:57:18 +01:00
|
|
|
if [[ $(curl -s -w "%{http_code}\n" http://localhost:5984/_up -o /dev/null) -ne 200 ]]; then
|
2022-06-22 14:38:33 +02:00
|
|
|
echo 'ERROR: CouchDB is not running';
|
|
|
|
healthy=false
|
|
|
|
fi
|
|
|
|
if [[ $(redis-cli -a $REDIS_PASSWORD --no-auth-warning ping) != 'PONG' ]]; then
|
|
|
|
echo 'ERROR: Redis is down';
|
|
|
|
healthy=false
|
|
|
|
fi
|
|
|
|
# mino, clouseau,
|
2022-06-23 16:03:09 +02:00
|
|
|
nginx -t -q
|
|
|
|
NGINX_STATUS=$?
|
|
|
|
|
|
|
|
if [[ $NGINX_STATUS -gt 0 ]]; then
|
|
|
|
echo 'ERROR: Nginx config problem';
|
|
|
|
healthy=false
|
|
|
|
fi
|
2022-06-22 14:38:33 +02:00
|
|
|
|
|
|
|
if [ $healthy == true ]; then
|
|
|
|
exit 0
|
|
|
|
else
|
|
|
|
exit 1
|
|
|
|
fi
|