Updating CTP with a Windows Batch script

This is a simple script that will allow us to update the Continuous Testing Platform when a new WAR is released
SET CTP_LOCATION=C:\parasoft\CTP SET UPDATE_FOLDER=c:\parasoft\update\CTPbackups SET NEW_CTP_WAR=C:\Downloads\em.war REM Adjust path to 7Zip program as needed below set THE_ZIP="c:\program files\7-zip\7z.exe" echo shutting down CTP... cd %CTP_LOCATION%\bin\ call shutdown.bat rem wait 20 seconds for CTP to shutdown PING 1.1.1.1 -n 1 -w 20000 >NUL echo copying files... Xcopy /Y %CTP_LOCATION%\hsqldb %UPDATE_FOLDER%\hsqldb\ /S copy /Y %CTP_LOCATION%\webapps\em\config\db_config.xml %UPDATE_FOLDER% copy /Y %CTP_LOCATION%\webapps\em\license %UPDATE_FOLDER% copy /Y %CTP_LOCATION%\webapps\em.war %UPDATE_FOLDER% echo removing old CTP... move /Y "%CTP_LOCATION%\webapps\em" %UPDATE_FOLDER% del %CTP_LOCATION%\webapps\em.war pause 10 echo expanding the em.war into tomcats webapps %THE_ZIP% x %NEW_CTP_WAR% -y -o%CTP_LOCATION%\webapps\em echo bringing old config files back in copy /Y %UPDATE_FOLDER%\db_config.xml %CTP_LOCATION%\webapps\em\config\db_config.xml copy /Y %UPDATE_FOLDER%\license %CTP_LOCATION%\webapps\em\license echo backup complete... cd c:/parasoft rem if you want to restart CTP after, uncomment this line rem call startCTP.bat
Tagged:
0
Comments
Additionally I will supply the startCTP.bat script. This starts CTP and Logs to a Virtualize workspace so that the logs show up in CTP.
SET LOG_LOCATION=C:\parasoft\workspace\VirtualAssets\logs\CTPlogs
cd C:\parasoft\CTP\bin
catalina.bat run > %LOG_LOCATION%\CTP.out 2>&1