2
0
mirror of https://github.com/frappe/frappe_docker.git synced 2024-11-08 22:31:07 +00:00
frappe_docker/tests/functions.sh

27 lines
594 B
Bash
Raw Normal View History

2021-11-04 12:31:49 +00:00
#!/bin/bash
print_group() {
echo ::endgroup::
echo "::group::$*"
}
ping_site() {
print_group "Ping site $SITE_NAME"
echo Ping version
ping_res=$(curl -sS "http://$SITE_NAME/api/method/version")
echo "$ping_res"
if [[ -z $(echo "$ping_res" | grep "message" || echo "") ]]; then
echo "Ping failed"
exit 1
fi
echo Check index
index_res=$(curl -sS "http://$SITE_NAME")
if [[ -n $(echo "$index_res" | grep "Internal Server Error" || echo "") ]]; then
echo "Index check failed"
echo "$index_res"
exit 1
fi
}