41 lines
1.2 KiB
Bash
41 lines
1.2 KiB
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
BASE_URL="${1:-${GE_INTEL_BASE_URL:-http://localhost:1202}}"
|
|
CAPABILITIES_URL="${BASE_URL%/}/api/v1/system/capabilities"
|
|
|
|
echo "== GeoIntel GIS runtime verification =="
|
|
echo "Checking: ${CAPABILITIES_URL}"
|
|
|
|
if ! command -v curl >/dev/null 2>&1; then
|
|
echo "curl is required for GIS runtime verification" >&2
|
|
exit 1
|
|
fi
|
|
|
|
response="$(curl -fsS "${CAPABILITIES_URL}")"
|
|
|
|
if printf '%s' "${response}" | grep -qi '<!doctype html'; then
|
|
echo "Capabilities endpoint returned HTML; frontend proxy/API routing is not correct" >&2
|
|
exit 1
|
|
fi
|
|
|
|
if ! printf '%s' "${response}" | grep -q '"postgis":true'; then
|
|
echo "PostGIS capability is not reported as available" >&2
|
|
printf '%s\n' "${response}" >&2
|
|
exit 1
|
|
fi
|
|
|
|
if ! printf '%s' "${response}" | grep -q '"rasterio":true'; then
|
|
echo "Rasterio capability is not reported as available in the running backend image" >&2
|
|
printf '%s\n' "${response}" >&2
|
|
exit 1
|
|
fi
|
|
|
|
if ! printf '%s' "${response}" | grep -q '"geopandas":true'; then
|
|
echo "GeoPandas capability is not reported as available in the running backend image" >&2
|
|
printf '%s\n' "${response}" >&2
|
|
exit 1
|
|
fi
|
|
|
|
echo "GIS runtime capabilities are available."
|