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
|
|
|
}
|