Files
MBS/scripts/deploy_mbs.cmd
T
2026-08-24 19:45:31 -04:00

72 lines
2.1 KiB
Batchfile

@echo off
setlocal EnableExtensions
REM ===========================================================================
REM deploy_mbs.cmd - Despliega el GAR del menu MBS en el GAS de ESTE server
REM
REM >>> CORRER EN EL SERVER (.251), en la consola donde funciona 'gasadmin' <<<
REM
REM Uso: deploy_mbs.cmd [ruta\al\mbs.gar]
REM Si no pasas ruta, busca mbs.gar en la carpeta actual.
REM
REM El nombre del ARCHIVE se toma del nombre del .gar (mbs.gar -> archive "mbs").
REM ===========================================================================
set "GAR=%~1"
if "%GAR%"=="" set "GAR=mbs.gar"
set "HOST=192.168.40.251"
set "PORT=6394"
if not exist "%GAR%" (
echo [ERROR] No se encuentra el GAR: "%GAR%"
echo Uso: %~nx0 [ruta\al\mbs.gar]
exit /b 1
)
REM --- nombre del archive = nombre del archivo sin extension ---
for %%F in ("%GAR%") do set "ARCHIVE=%%~nF"
echo(
echo ============================================================
echo DEPLOY MBS GAR="%GAR%" ARCHIVE=%ARCHIVE%
echo ============================================================
echo(
echo --- 1) Estado actual ---
gasadmin gar --list-archives
echo(
echo --- 2) Quitando version anterior (los "Command failed / No archive" aqui son NORMALES en el 1er deploy) ---
gasadmin gar --disable-archive %ARCHIVE%
gasadmin gar --undeploy-archive %ARCHIVE% -y
gasadmin gar --clean-archives
echo(
echo --- 3) Desplegando nueva version ---
gasadmin gar --deploy-archive "%GAR%" -y
if errorlevel 1 (
echo [ERROR] Fallo el deploy del GAR.
exit /b 1
)
echo(
echo --- 4) Habilitando ---
gasadmin gar --enable-archive %ARCHIVE%
if errorlevel 1 (
echo [ERROR] Fallo al habilitar el archive.
exit /b 1
)
echo(
echo --- 5) Estado final ---
gasadmin gar --list-archives
echo(
echo ============================================================
echo LISTO. Abre en el navegador:
echo http://%HOST%:%PORT%/ua/r/Application
echo ============================================================
echo Nota: si reconstruiste con BinaryName=MAINMENU, la app se
echo llamara MAINMENU y la URL sera /ua/r/MAINMENU
echo(
endlocal