Multiple environments with Tomcat/DA

Similar to the previous post about configuring dqMan/DQLTester (Multiple environments with dqMan/DQLTester), a Tomcat with DA can be configured the same way:

Folder structure:

  • da.bat
  • bin
  • conf
  • jre
  • lib
  • logs
  • webapps
  • properties
    • env1
      • dev
        • dfc.properties
        • dmcl.ini
      • prod
        • dfc.properties
        • dmcl.ini
    • env2
      • dev
        • dfc.properties
        • dmcl.ini
      • prod
        • dfc.properties
        • dmcl.ini
  • etc.

DA.bat:

@Echo off
SETLOCAL ENABLEEXTENSIONS
SET folderbase=dfcproperties

echo ****************
echo 1. env1 dev
echo 2. env2 prod
...
echo ****************

SET /p var= ^> Choose option: 

if "%var%"=="1" goto op1
if "%var%"=="2" goto op2
...

:op1
SET foldervar=%folderbase%\env1\dev
goto finish

:op2
SET foldervar=%folderbase%\env1\prod
goto finish
...

:finish
set JAVA_HOME=%cd%\jre
set JAVA_OPTS=-Ddfc.properties.file=%cd%\%foldervar%\dfc.properties -Dfile.encoding=UTF-8 -Xms128m -Xmx512m -XX:+UseG1GC -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addresses=true -Djava.net.preferIPv6Addresses=false -Djava.net.preferIPv6Stack=false

start "" /D %cd%\bin /B %cd%\bin\catalina.bat start
cls&exit

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s