2757869176
Add contract validation, SMTP delivery results, terminal failure context, neutral development seeding, and local Docker setup. Ref: IT-1033
73 lines
2.1 KiB
Batchfile
73 lines
2.1 KiB
Batchfile
@echo off
|
|
setlocal
|
|
|
|
set "SCRIPT_DIR=%~dp0"
|
|
for %%I in ("%SCRIPT_DIR%..\..") do set "REPOSITORY_ROOT=%%~fI"
|
|
set "ENV_FILE=%SCRIPT_DIR%.env.Development"
|
|
set "BASE_COMPOSE=%SCRIPT_DIR%docker-compose.yml"
|
|
set "DEVELOPMENT_COMPOSE=%SCRIPT_DIR%docker-compose.Development.yml"
|
|
|
|
where docker >nul 2>&1
|
|
if errorlevel 1 goto docker_missing
|
|
|
|
docker info >nul 2>&1
|
|
if errorlevel 1 goto docker_unavailable
|
|
|
|
if not exist "%ENV_FILE%" goto environment_missing
|
|
|
|
pushd "%REPOSITORY_ROOT%"
|
|
if errorlevel 1 goto repository_unavailable
|
|
|
|
echo Validating the development Docker Compose configuration...
|
|
docker compose --env-file "%ENV_FILE%" -f "%BASE_COMPOSE%" -f "%DEVELOPMENT_COMPOSE%" config --quiet
|
|
if errorlevel 1 goto compose_invalid
|
|
if /i "%~1"=="--validate-only" goto validation_complete
|
|
|
|
echo Building and starting the Notification Service development environment...
|
|
docker compose --env-file "%ENV_FILE%" -f "%BASE_COMPOSE%" -f "%DEVELOPMENT_COMPOSE%" up --build -d
|
|
if errorlevel 1 goto installation_failed
|
|
|
|
echo.
|
|
docker compose --env-file "%ENV_FILE%" -f "%BASE_COMPOSE%" -f "%DEVELOPMENT_COMPOSE%" ps
|
|
|
|
echo.
|
|
echo Notification Service development environment is running.
|
|
echo Admin: http://localhost:5200/admin/channels
|
|
echo RabbitMQ: http://localhost:15672
|
|
echo Mailpit: http://localhost:8025
|
|
echo Seq: http://localhost:5342
|
|
echo.
|
|
popd
|
|
exit /b 0
|
|
|
|
:validation_complete
|
|
echo Development Docker Compose configuration is valid.
|
|
popd
|
|
exit /b 0
|
|
|
|
:compose_invalid
|
|
echo ERROR: The development Docker Compose configuration is invalid.
|
|
popd
|
|
exit /b 1
|
|
|
|
:installation_failed
|
|
echo ERROR: Failed to build or start the development environment.
|
|
popd
|
|
exit /b 1
|
|
|
|
:docker_missing
|
|
echo ERROR: Docker CLI was not found. Install and start Docker Desktop, then run this script again.
|
|
exit /b 1
|
|
|
|
:docker_unavailable
|
|
echo ERROR: Docker is installed, but the Docker engine is not available. Start Docker Desktop and try again.
|
|
exit /b 1
|
|
|
|
:environment_missing
|
|
echo ERROR: Development environment file was not found: "%ENV_FILE%"
|
|
exit /b 1
|
|
|
|
:repository_unavailable
|
|
echo ERROR: Repository root is not available: "%REPOSITORY_ROOT%"
|
|
exit /b 1
|