dcsimg
What is the right way to deploy to Tomcat when you have machine specific configurations in (i.e.) three environments DEV, TEST, PROD?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   A_Beland
Posted On:   Wednesday, August 4, 2004 08:33 PM

Using Ant, a good developer will compile once (and only once) and package the web application in a war file. Let's say you have three environments: DEV, TEST and PROD, where each has it's own specific configuration. The process being that once a web application is compiled in DEV, the war file is "deployed" to TEST. Once acceptance testing in done in TEST, the web app. is then "deployed" to PROD. But... My understanding is that environment-dependent settings (i.e. datasources information) should go in the context.xml file under META-INF (application-dependent settings go into the web.xml file under WEB-INF and never changes from one environment to the next). But when do you "add" configuration    More>>

Using Ant, a good developer will compile once (and only once) and package the web application in a war file.


Let's say you have three environments: DEV, TEST and PROD, where each has it's own specific configuration. The process being that once a web application is compiled in DEV, the war file is "deployed" to TEST. Once acceptance testing in done in TEST, the web app. is then "deployed" to PROD. But...


My understanding is that environment-dependent settings (i.e. datasources information) should go in the context.xml file under META-INF (application-dependent settings go into the web.xml file under WEB-INF and never changes from one environment to the next). But when do you "add" configuration information?


I do NOT want to recompile the web application again. Theoretically, you should be deploying the EXACT SAME war file from TEST to PROD - or else what's the point of testing. One exception could be made for the contents of the META-INF directory in the war file.


Q1: Which is best, "deploy" two files (myapp.xml and myapp.war)? Or, deploy one war file with the environment configurations added to it via an formal Ant task (to prevent possible screw-ups)?


Q2: Using Ant, is it possible to "add" the context.xml file to an existing war file? Is this the right way to add DEV/TEST/PROD-specific information? What is state-of-the-art best practice using Ant and Tomcat 4.x?


Q3: How do you deploy to production servers without having to restart Tomcat? Depending on how Tomcat is configured, we're getting different results. We should be able to deploy a new, or replace an existing, web application without having to stop and start Tomcat (which affects all web applications deployed). What's the BEST modern way to configure tomcat (server.xml) today to support this kind of robust deployment?


Q4: For production, are the ANT undeploy and deploy tasks the correct ones to use (as opposed to install)?


THANKS!

   <<Less

Re: What is the right way to deploy to Tomcat when you have machine specific configurations in (i.e.) three environments DEV, TEST, PROD?

Posted By:   AlessandroA_Garbagnati  
Posted On:   Sunday, August 8, 2004 02:08 AM

Hi,

What I suggest you is to take a look at the Deployer package that is provided with Tomcat 5 (it's an external download package, that can be downloaded from the same jakarta download page).

It's an interesting tool that can help you preparing the deployment and answering to some of your questions. It (obviously) uses ant, so you can eventually use them and improve the scripts on your needs.

The Deployer Tool Documentation page can give you some futher information.
About | Sitemap | Contact