The staging noindex (MITHOME-116) hinges on a build variable; leaking it into production would silently drop the site from Google. deploy.sh now refuses to build production when NEXT_PUBLIC_DEPLOY_ENV=staging is set, and after every deploy runs scripts/check-indexability.sh, expecting an indexable production and a blocked staging (node tests cover both ways, stray noindex and unreachable endpoints; added to pre-deploy tests). A separate Playwright project, production-seo (npm run test:seo:production), checks robots.txt, that all 12 sitemap URLs are final/indexable with self canonicals and sitemap hreflangs, SSR content and links, the / -> /hu redirect and real 404s; host redirects are gated until the production domain is live. Verified on a production-mode build of a staging DB copy (5 passed) and failing as expected against staging. eslint now ignores generated test output (playwright-report, test-results, coverage), which broke the pre-deploy lint after local e2e runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
52 lines
2.9 KiB
Bash
Executable File
52 lines
2.9 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Teljeskörű pre-deploy tesztkészlet — minden deploy előtt futtatandó.
|
|
# Összefogja a proto (weboldal) és a gyökér (CMS/infra) lokális tesztjeit;
|
|
# csoportonkénti PASS/FAIL összegzéssel, hiba esetén nem-nulla exit kód.
|
|
#
|
|
# Használat: scripts/pre-deploy-tests.sh
|
|
# A deploy_to_stage_on_local.sh 1. lépésként futtatja.
|
|
|
|
set -uo pipefail
|
|
|
|
readonly ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
FAILED=()
|
|
|
|
run() {
|
|
local name="$1"; shift
|
|
printf '\n── %s\n' "$name"
|
|
if "$@"; then
|
|
printf '✅ %s\n' "$name"
|
|
else
|
|
printf '❌ %s\n' "$name"
|
|
FAILED+=("$name")
|
|
fi
|
|
}
|
|
|
|
# ── Weboldal (proto) ─────────────────────────────────────────────────────────
|
|
run "proto: unit tesztek (jest, 60+)" bash -c "cd '${ROOT}/proto' && npm test --silent"
|
|
run "proto: típusellenőrzés (tsc --noEmit)" bash -c "cd '${ROOT}/proto' && npx tsc --noEmit"
|
|
run "proto: lint (eslint)" bash -c "cd '${ROOT}/proto' && npm run lint"
|
|
|
|
# ── Tartalom ─────────────────────────────────────────────────────────────────
|
|
run "content: séma-validáció (minden JSON)" node "${ROOT}/scripts/test-content-schema.js"
|
|
|
|
# ── CMS ──────────────────────────────────────────────────────────────────────
|
|
# WHY nincs itt önálló CMS-tesztblokk: a régi egyedi CMS-t (content-editor.js
|
|
# + scripts/cms-*.js + a hozzá tartozó test-content-editor-*.js szkriptek)
|
|
# a Payload CMS-re állás (MITHOME-91/92) után leépítettük (MITHOME-93) — a
|
|
# Payload admin felület saját, upstream teszteléssel rendelkezik, ezt itt nem
|
|
# duplikáljuk. Payload collection/global konfigurációk saját tesztlefedettsége
|
|
# külön feladat (MITHOME-96), még nincs implementálva.
|
|
|
|
# ── Infra ────────────────────────────────────────────────────────────────────
|
|
run "plane: sync unit tesztek" node --test "${ROOT}/scripts/plane/plane-sync.test.js"
|
|
run "infra: indexelhetőségi őr (MITHOME-127)" node --test "${ROOT}/scripts/check-indexability.test.js"
|
|
|
|
# ── Összegzés ────────────────────────────────────────────────────────────────
|
|
printf '\n────────────────────────────────────────\n'
|
|
if [ "${#FAILED[@]}" -gt 0 ]; then
|
|
printf '❌ %d tesztcsoport HIBÁS: %s\n' "${#FAILED[@]}" "${FAILED[*]}"
|
|
exit 1
|
|
fi
|
|
printf '✅ Minden pre-deploy teszt zöld.\n'
|