v4.1.24: Добавлены поля arve_checked и arve_makstud
- FEAT: Добавлены поля arve_checked (int) и arve_makstud (string) в production_records
- POST /api/records: INSERT с arve_checked, arve_makstud
- PUT /api/records/🆔 UPDATE с arve_checked, arve_makstud
- Docker: docker-compose.prod.yml, ecosystem.config.cjs (PM2)
- wrangler.toml → wrangler.jsonc
- seed.sql: полные тестовые данные
- test_browser.js: E2E тесты
- Удалены старые HOTFIX-файлы (v4.1.11-v4.1.23)
- Удалены data/*.sqlite из репозитория
This commit is contained in:
@@ -1,61 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
PORT="${PORT:-3000}"
|
||||
D1_BINDING="${D1_BINDING:-aknaproff-db}"
|
||||
PERSIST_PATH="${PERSIST_PATH:-/data}"
|
||||
SEED_DATA="${SEED_DATA:-false}"
|
||||
SEED_SENTINEL="${PERSIST_PATH}/.seeded"
|
||||
SKIP_MIGRATIONS="${SKIP_MIGRATIONS:-true}" # ⚠️ По умолчанию пропускаем миграции!
|
||||
|
||||
mkdir -p "${PERSIST_PATH}"
|
||||
export WRANGLER_SEND_METRICS="${WRANGLER_SEND_METRICS:-false}"
|
||||
|
||||
apply_migrations() {
|
||||
if [[ "${SKIP_MIGRATIONS,,}" == "true" ]]; then
|
||||
echo "[entrypoint] Skipping migrations (SKIP_MIGRATIONS=true)"
|
||||
echo "[entrypoint] Using existing database from ${PERSIST_PATH}"
|
||||
return
|
||||
fi
|
||||
|
||||
echo "[entrypoint] Applying D1 migrations (binding: ${D1_BINDING}, persist: ${PERSIST_PATH})"
|
||||
npx wrangler d1 migrations apply "${D1_BINDING}" \
|
||||
--local \
|
||||
--persist-to "${PERSIST_PATH}"
|
||||
}
|
||||
|
||||
maybe_seed_data() {
|
||||
if [[ "${SEED_DATA,,}" != "true" ]]; then
|
||||
echo "[entrypoint] Seed step disabled (set SEED_DATA=true to enable)"
|
||||
return
|
||||
fi
|
||||
|
||||
if [[ -f "${SEED_SENTINEL}" ]]; then
|
||||
echo "[entrypoint] Seed data already applied (skipping)"
|
||||
return
|
||||
fi
|
||||
|
||||
echo "[entrypoint] Seeding local database from seed.sql"
|
||||
if npx wrangler d1 execute "${D1_BINDING}" \
|
||||
--local \
|
||||
--persist-to "${PERSIST_PATH}" \
|
||||
--file ./seed.sql; then
|
||||
touch "${SEED_SENTINEL}"
|
||||
else
|
||||
echo "[entrypoint] Seed step failed but container will continue" >&2
|
||||
fi
|
||||
}
|
||||
|
||||
start_server() {
|
||||
echo "[entrypoint] Starting Wrangler dev server on port ${PORT}"
|
||||
exec npx wrangler pages dev dist \
|
||||
--local \
|
||||
--d1="${D1_BINDING}" \
|
||||
--persist-to "${PERSIST_PATH}" \
|
||||
--ip 0.0.0.0 \
|
||||
--port "${PORT}"
|
||||
}
|
||||
|
||||
apply_migrations
|
||||
maybe_seed_data
|
||||
start_server
|
||||
Reference in New Issue
Block a user