HyperBrickCaseOps / scripts /validate-submission.sh
modelbuilderhq's picture
Upload folder using huggingface_hub
181758b verified
raw
history blame contribute delete
735 Bytes
#!/usr/bin/env bash
set -euo pipefail
PING_URL="${1:-}"
REPO_DIR="${2:-.}"
IMAGE_TAG="supportdesk-env-validate"
if [ -z "$PING_URL" ]; then
echo "Usage: ./scripts/validate-submission.sh <space_url> [repo_dir]"
exit 1
fi
echo "[1/4] Validating local OpenEnv project structure"
(cd "$REPO_DIR" && openenv validate .)
echo "[2/4] Building Docker image"
(cd "$REPO_DIR" && docker build -t "$IMAGE_TAG" .)
echo "[3/4] Checking public Space health"
curl -fsSL "$PING_URL/health" >/dev/null
curl -fsSL "$PING_URL/openapi.json" >/dev/null
echo "[4/4] Checking public reset endpoint"
curl -fsSL -X POST "$PING_URL/reset" \
-H "Content-Type: application/json" \
-d '{}' >/dev/null
echo "Validation checks completed successfully."