fix(shadow): capture and validate inbound task evidence for v3.4
This commit is contained in:
@@ -10,31 +10,37 @@ set "DATABASE=%~2"
|
||||
set "MODE=%~3"
|
||||
set "SQL_FILE="
|
||||
set "V33_FILE=%~dp0..\fortucky-algorithm\src\main\resources\db\sqlserver\upgrade-shadow-v3-to-v33.sql"
|
||||
set "V34_FILE=%~dp0..\fortucky-algorithm\src\main\resources\db\sqlserver\upgrade-shadow-v33-to-v34.sql"
|
||||
|
||||
if /I "%~3"=="upgrade" set "SQL_FILE=%~dp0..\fortucky-algorithm\src\main\resources\db\sqlserver\upgrade-shadow-v2-to-v3.sql"
|
||||
if /I "%~3"=="clean" set "SQL_FILE=%~dp0..\fortucky-algorithm\src\main\resources\db\sqlserver\install-shadow.sql"
|
||||
if /I "%~3"=="v33" set "SQL_FILE=%V33_FILE%"
|
||||
if not defined SQL_FILE (call :fail "mode must be upgrade, clean or v33" & exit /b 1)
|
||||
if /I "%~3"=="v34" set "SQL_FILE=%V34_FILE%"
|
||||
if not defined SQL_FILE (call :fail "mode must be upgrade, clean, v33 or v34" & exit /b 1)
|
||||
if not exist "%SQL_FILE%" (call :fail "SQL package file is missing" & exit /b 1)
|
||||
if not exist "%V33_FILE%" (call :fail "V3.3 SQL package file is missing" & exit /b 1)
|
||||
if not exist "%V34_FILE%" (call :fail "V3.4 SQL package file is missing" & exit /b 1)
|
||||
|
||||
where sqlcmd >nul 2>nul
|
||||
if errorlevel 1 (call :fail "sqlcmd is not available on PATH" & exit /b 1)
|
||||
|
||||
echo WARNING: stop the WMS shadow-enabled JVM and wait over 120 seconds first.
|
||||
echo Installing FT546WMS shadow V3.3 in %MODE% mode...
|
||||
echo Installing FT546WMS shadow package in %MODE% mode...
|
||||
sqlcmd -S "%SQL_SERVER%" -d "%DATABASE%" -E -b -r1 -i "%SQL_FILE%"
|
||||
if errorlevel 1 exit /b 1
|
||||
if /I "%MODE%"=="v33" goto :installed
|
||||
if /I "%MODE%"=="v34" goto :installed
|
||||
sqlcmd -S "%SQL_SERVER%" -d "%DATABASE%" -E -b -r1 -i "%V33_FILE%"
|
||||
if errorlevel 1 exit /b 1
|
||||
sqlcmd -S "%SQL_SERVER%" -d "%DATABASE%" -E -b -r1 -i "%V34_FILE%"
|
||||
if errorlevel 1 exit /b 1
|
||||
|
||||
:installed
|
||||
echo INSTALL_OK mode=%MODE%
|
||||
exit /b 0
|
||||
|
||||
:usage
|
||||
echo Usage: %~nx0 SQL_SERVER DATABASE upgrade^|clean^|v33 1>&2
|
||||
echo Usage: %~nx0 SQL_SERVER DATABASE upgrade^|clean^|v33^|v34 1>&2
|
||||
exit /b 2
|
||||
|
||||
:fail
|
||||
|
||||
Reference in New Issue
Block a user