50 lines
1.7 KiB
Bash
Executable File
50 lines
1.7 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -Eeuo pipefail
|
|
|
|
ROOT="${ROOT:-/var/www/dhv2.korexlabs.com}"
|
|
cd "$ROOT"
|
|
API_URL="${API_URL:-http://127.0.0.1:3101/api/v3}"
|
|
|
|
echo "========== D5.3.2.1 · VERSIONES =========="
|
|
API_VERSION="$(node -p "require('./api-v3/package.json').version")"
|
|
WEB_VERSION="$(node -p "require('./web-v2/package.json').version")"
|
|
[[ "$API_VERSION" == "0.19.3-2.1" ]]
|
|
[[ "$WEB_VERSION" == "0.19.3-2.1" ]]
|
|
echo "API: $API_VERSION"
|
|
echo "WEB: $WEB_VERSION"
|
|
|
|
echo
|
|
echo "========== D5.3.2.1 · MIGRACIONES =========="
|
|
MIGRATION_OUTPUT="$(docker compose --profile tools run --rm migrate npm run migration:show 2>&1)"
|
|
echo "$MIGRATION_OUTPUT"
|
|
grep -q "Pending migrations: no" <<<"$MIGRATION_OUTPUT"
|
|
|
|
echo
|
|
echo "========== D5.3.2.1 · HEALTH =========="
|
|
HEALTH="$(curl -fsS "$API_URL/health")"
|
|
echo "$HEALTH"
|
|
grep -q '"version":"0.19.3-2.1"' <<<"$HEALTH"
|
|
grep -q '"phase":"D5.3.2.1"' <<<"$HEALTH"
|
|
|
|
echo
|
|
echo "========== D5.3.2.1 · HOTFIX VERSIONADO =========="
|
|
grep -q 'SET current_version = COALESCE(current_version, 0) + 1' api-v3/src/asset-master/asset-history.service.ts
|
|
grep -q 'SELECT current_version' api-v3/src/asset-master/asset-history.service.ts
|
|
test -f api-v3/test/unit/asset-history-capture.test.ts
|
|
grep -q 'asset history capture increments then reads current_version' api-v3/test/unit/asset-history-capture.test.ts
|
|
echo "Incremento + lectura explícita de current_version y test de regresión: OK"
|
|
|
|
echo
|
|
echo "========== D5.3.2.1 · DEMO =========="
|
|
bash -n scripts/dev-seed-mendoza-demo.sh
|
|
bash -n scripts/dev-clean-demo.sh
|
|
grep -q 'DH-DEV-DEMO:ITN124/2026' api-v3/src/cli/dev-seed-mendoza-demo.ts
|
|
echo "Seed y limpiador disponibles: OK"
|
|
|
|
echo
|
|
echo "========== D5.3.2.1 · CONTENEDORES =========="
|
|
docker compose ps -a
|
|
|
|
echo
|
|
echo "ACEPTACIÓN DE FASE D5.3.2.1: OK"
|