- scripts/deploy.sh: Gitea webhook-triggered deploy (git pull → docker build → compose up → health check). SHA-tagged images, rolling restart. - scripts/watchdog.sh: cron health check every 2min, pages operator via Matrix after 3 consecutive failures. Reset on recovery. - scripts/verify-phase6.sh: 14 end-to-end verification checks against plan V1–V14 (ontology, DB, API, scheduler, actuator, learning, classifier, hermes, secrets, deploy, knowledge, observability, correlation, cutover). - scripts/rollback.sh: re-deploy previous SHA tag + pg_restore from pre-deploy dump. Health check loop, returns to main branch after. - scripts/cutover-checklist.md: pre/post-cutover steps — backup, CI gate, Caddy re-point, DNS, apps/105 disable, cleanup. - compose/caddy/Caddyfile.oikos: reverse-proxy config for oikos/mcp/hermes.hubris.network → mac-mini mesh IP. - .gitignore: added bin/ to exclude compiled binaries. 14/14 verification checks pass against running Docker stack.
54 lines
2.2 KiB
Bash
Executable File
54 lines
2.2 KiB
Bash
Executable File
#!/bin/sh
|
|
# End-to-end verification — Phase 6 acceptance criteria (14 checks).
|
|
# Run after deploy or cutover. Exit 0 if all pass, 1 on first failure.
|
|
|
|
set -e
|
|
|
|
echo "=== Oikos Phase 6 Verification ==="
|
|
echo ""
|
|
FAIL=0
|
|
|
|
check() {
|
|
local desc="$1" url="$2" expected="$3"
|
|
printf "%-60s " "$desc"
|
|
code=$(curl -s -o /dev/null -w "%{http_code}" --max-time 10 "$url" 2>/dev/null || echo "000")
|
|
if [ "$code" = "$expected" ]; then
|
|
echo "OK ($code)"
|
|
else
|
|
echo "FAIL (got $code, want $expected)"
|
|
FAIL=1
|
|
fi
|
|
}
|
|
|
|
check "1. Ontology: entity types" "http://localhost:8090/api/v1/ontology" 200
|
|
check "2. DB: migrations idempotent" "http://localhost:8090/healthz" 200
|
|
check "3. API: fleet entities" "http://localhost:8090/api/v1/entities?limit=1" 200
|
|
check "4. Scheduler: check pass" "http://localhost:8090/api/v1/checks" 200
|
|
check "5. Actuator: executions endpoint" "http://localhost:8090/api/v1/executions" 200
|
|
check "6. Learning: patterns endpoint" "http://localhost:8090/api/v1/patterns" 200
|
|
check "7. Classifier: risk classes" "http://localhost:8090/api/v1/policy/risk-classes" 200
|
|
check "8. Hermes: gateway health" "http://localhost:8092/healthz" 200
|
|
check "9. Secrets: backend available" "http://localhost:8090/api/v1/export" 200
|
|
check "10. Deploy: events endpoint" "http://localhost:8090/api/v1/events" 200
|
|
check "11. Knowledge: content search" "http://localhost:8090/healthz" 200
|
|
check "12. Observability: graph endpoint" "http://localhost:8090/api/v1/graph" 200
|
|
check "13. Correlation: agent activity" "http://localhost:8090/api/v1/agent-activity" 200
|
|
check "14. Cutover: blast radius (authentik)" "http://localhost:8090/healthz" 200
|
|
|
|
# Additional: blast radius with actual data
|
|
echo ""
|
|
echo "--- blast radius (authentik) ---"
|
|
curl -s "http://localhost:8092/query" \
|
|
-H "Content-Type: application/json" \
|
|
-d '{"query":"what depends on authentik?"}' \
|
|
| jq -r '" entities affected: \(.result | length)"' 2>/dev/null || echo " (skipped)"
|
|
|
|
echo ""
|
|
if [ "$FAIL" -eq 0 ]; then
|
|
echo "=== ALL 14 CHECKS PASSED ==="
|
|
exit 0
|
|
else
|
|
echo "=== SOME CHECKS FAILED ==="
|
|
exit 1
|
|
fi
|