2
0
mirror of https://github.com/frappe/frappe_docker.git synced 2025-01-10 09:02:13 +00:00
frappe_docker/tests/functions.sh

27 lines
550 B
Bash
Raw Normal View History

2021-11-04 12:31:49 +00:00
#!/bin/bash
print_group() {
2021-12-10 08:56:18 +00:00
echo ::endgroup::
echo "::group::$*"
2021-11-04 12:31:49 +00:00
}
ping_site() {
2021-12-10 08:56:18 +00:00
print_group "Ping site $SITE_NAME"
2021-11-04 12:31:49 +00:00
2021-12-10 08:56:18 +00:00
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
2021-11-04 12:31:49 +00:00
2021-12-10 08:56:18 +00:00
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
2021-11-04 12:31:49 +00:00
}