Wiki/scripts/smoke-test.sh
Corentin JOGUET 668576cdc4 chore: initial commit — formation-hub conception phase
Conception complete (Phase 0) pour formation-hub Acadenice :

- 19 docs Merise Agile + UML + GitOps + plans (tests/deploy/ops/api)
  cf docs/00-readme.md pour l'index complet
- Stack Docker compose (Docmost + Baserow + Postgres + Redis + MinIO local FS)
  compose.yml + compose.staging.yml + compose.prod.yml
- CI/CD GitHub Actions skeleton (ci, deploy-staging, deploy-prod)
- Bridge service skeleton (Hono + TS + Biome + Vitest + zod + pino)
- Templates GitHub : PR + 3 issue types + CODEOWNERS + dependabot.yml
- Scripts ops : healthcheck, backup quotidien, smoke-test post-deploy
- LICENSE AGPL-3.0 + SECURITY.md + CONTRIBUTING.md + CHANGELOG.md
- Diagramme drawIO archi infra (XML importable dans diagrams.net)

Decisions structurelles enregistrees :
- Scope CFA + Agence avec entite PERSONNE pivot multi-roles (ADR-001)
- Stack composite Docmost AGPL + Baserow MIT + bridge custom (ADR-001)
- Path B : UX quasi-unified via Tiptap node-views custom (ADR-002)
- Monorepo trunk-based development (ADR-003)
- Postgres separe Docmost/Baserow (ADR-004)
- Bridge stack Node 22 + Hono (ADR-005)
- Repo neuf prefere a fork Docmost
- Prod-like des le jour 1 (pas MVP)
2026-05-07 12:16:19 +02:00

34 lines
980 B
Bash
Executable file

#!/usr/bin/env bash
# scripts/smoke-test.sh — test post-deploy minimal
set -euo pipefail
ENV_URL="${1:-${SMOKE_URL:-http://localhost:3000}}"
TIMEOUT=10
echo "Smoke test against $ENV_URL"
# 1. Healthcheck
echo " [1/3] HEAD $ENV_URL"
curl -sfI --max-time $TIMEOUT "$ENV_URL" > /dev/null
# 2. Resolve auth.info (assumes Outline-style API)
if [ -n "${SMOKE_AUTH_TOKEN:-}" ]; then
echo " [2/3] auth.info"
curl -sf -X POST --max-time $TIMEOUT \
-H "Authorization: Bearer $SMOKE_AUTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{}' "$ENV_URL/api/auth.info" > /dev/null
else
echo " [2/3] auth.info — SKIP (SMOKE_AUTH_TOKEN absent)"
fi
# 3. Search
if [ -n "${SMOKE_AUTH_TOKEN:-}" ]; then
echo " [3/3] documents.search"
curl -sf -X POST --max-time $TIMEOUT \
-H "Authorization: Bearer $SMOKE_AUTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{"query":"smoke"}' "$ENV_URL/api/documents.search" > /dev/null
fi
echo "Smoke test OK"