Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Updating CTP with a Windows Batch script

[Deleted User]
[Deleted User] Posts: 0 admin
edited December 2016 in CTP

This is a simple script that will allow us to update the Continuous Testing Platform when a new WAR is released

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 -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


  • [Deleted User]
    [Deleted User] Posts: 0 admin

    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