@echo off setlocal ENABLEEXTENSIONS echo [INFO] Verify WaouW package REM 1) docker compose syntax docker compose -f DEPLOY\docker-compose.yml config >nul 2>&1 if errorlevel 1 ( echo [ERR] docker-compose.yml invalid (docker compose config failed) exit /b 1 ) else ( echo [OK] compose syntax ) REM 2) Frontend markers in compose findstr /I /C:"VITE_API_URL" /C:"condition: service_healthy" /C:"healthcheck:" DEPLOY\docker-compose.yml >nul if errorlevel 1 ( echo [ERR] Missing frontend markers (VITE_API_URL / depends_on healthy / healthcheck) exit /b 1 ) else ( echo [OK] compose frontend markers ) REM 3) Check deploy zip exists if not exist DEPLOY\waouw-deploy.zip ( echo [ERR] DEPLOY\waouw-deploy.zip not found exit /b 1 ) REM 4) Inside deploy zip: version.ver and v-*.ver present powershell -NoProfile -Command ^ "$p='DEPLOY\waouw-deploy.zip';" ^ "$z=[IO.Compression.ZipFile]::OpenRead((Resolve-Path $p));" ^ "$names=$z.Entries.Name;" ^ "$has1=$names -contains 'version.ver';" ^ "$has2=$names -match '^v-\d+-\d+-\d+\.ver$';" ^ "$z.Dispose();" ^ "if(-not $has1 -or -not $has2){ exit 2 }" if errorlevel 2 ( echo [ERR] version.ver and/or v-*-*.ver missing in deploy zip exit /b 1 ) else ( echo [OK] deploy zip version files ) REM 5) Latest sources zip must NOT contain 'Versions/' folder for /f "usebackq delims=" %%Z in (`powershell -NoProfile -Command ^ "$z=(Get-ChildItem -Path 'Versions' -Filter '*-src.zip' -EA SilentlyContinue | Sort-Object LastWriteTime -Desc | Select-Object -First 1); if($z){ $z.FullName }"`) do set SRCZIP=%%Z if "%SRCZIP%"=="" ( echo [WARN] No sources zip found in Versions\ (skip check) ) else ( powershell -NoProfile -Command ^ "$p='%SRCZIP%'; $z=[IO.Compression.ZipFile]::OpenRead((Resolve-Path $p));" ^ "$bad=$false; foreach($e in $z.Entries){ if($e.FullName -match '^Versions/'){ $bad=$true; break } }" ^ "$z.Dispose();" ^ "if($bad){ exit 3 }" if errorlevel 3 ( echo [ERR] Sources zip contains 'Versions/' (should be excluded) exit /b 1 ) else ( echo [OK] sources zip excludes 'Versions/' ) ) echo [OK] All checks passed endlocal exit /b 0