Reputation: 146
I have an azure server that runs my Tomcat web apps. Everything works well but I find that exporting my war, undeploying, then redeploying the war to Tomcat is a hassle. On my dev environment I run Tomcat within eclipse and have my latest code to run. What would be the problem with running eclipse on my azure server, having Tomcat run within eclipse to run my web apps? This way with any change I can simply git pull my latest code into eclipse and restart tomcat. Is this a bad idea in production and why? If so any recommendations on how to make this easier? I would rather not expose the tomcat manager application to the world so please don't recommend that.
Upvotes: 0
Views: 631
Reputation: 5113
Which is all nice and fine if you are doing development, but for production you shouldn't need the Development Code Environment, rather the production should always contain the runtimes. Which anyways in case of Azure Webapp with Tomcat8 is available (you don't actually need eclipse on the server). I think your worry is that if you use the Azure WebApps than your Tomcat manager will be exposed to the world, if thats the case I suggest you use "Jetty" blade to deploy your app rather then using the Tomcat, if you use Jetty than the basic page would be "Nothing" unless you push code. More Detailed overview of Using Azure Webapp deployment with Jetty is Available here https://azure.microsoft.com/en-in/documentation/articles/web-sites-java-get-started/
Upvotes: 0
Reputation: 24138
Per my experience, the easy way to continuous deployment for Tomcat web apps in Eclipse is using local Git repository.
First, Create a Dynamic Web Project
with Tomcat in Eclipse. There is a key step for creating project different from normal step. When configuring web module settings, need to set webapps/ROOT
for Content directory, see below:
Then, the project structure tree as below:
Second, Configure the continuous deployment for Azure WebApp on Azure Portal.
After done above, copy the git clone url for git cmd.
Until now, open the git bash to push project into Azure. The steps as below.
cd
into project directory <app-name>
.git init
git add webapps
git commit -m "Initial Commit"
git remote add <app-name> <git-clone-url>
git push <app-name> master
Now, you can browse https://<app-name>.azurewebsites.net/
to see it.
For continous developement, you just need to repeat the step 3, 4 and 6.
Upvotes: 1