10

Our current environment has Tomcat containers sitting behind an Apache Web Server. Basically the web server has ProxyPass rules that we use to decide which Tomcat instance to route to based on the context root.

As part of our local gradle build, we are using the Cargo plugin to spin up a local tomcat container and deploying our war's to it. I haven't found anything that will let us spin up an Apache WebServer to test our apache config.

Our goal is to have two Tomcat containers, A and B, and one Apache WebServer C, such that C will route localhost/appA to tomcat A and localhost/appB to tomcat B.

This is all in an effort to run automated acceptance tests, but I have not found a gradle plugin like cargo that will do this.

Thanks!

Community
  • 1
  • 1
75inchpianist
  • 4,112
  • 1
  • 21
  • 39
  • This is not a direct solution to your question, but it helps to use tools like the Jenkins CI server to handle acceptance tests using a build pipeline concept. In that scenario, you have a variety of tools at your disposal including writing shell script to setup different servers and do deployments to remote server installations to run your acceptance tests. – horatius Jan 26 '16 at 19:30
  • I am currently using Jenkins, but this is not a solution as I am trying to set up a local acceptance framework as well. Needs to reside within the context of the build. – 75inchpianist Jan 26 '16 at 20:30
  • Is there anything of this sort for Maven? just curious. – RaGe Jan 26 '16 at 20:57
  • I don't have a Tomcat/Apache/Gradle environment to test this right now, but you can execute programs with a Groovy script using `process`/`execute()`, I did that with Inkscape [in this answer](http://stackoverflow.com/a/27639730/1781026). Maybe it is of some use for you or someone trying to answer – chrki Feb 03 '16 at 15:48

1 Answers1

0

You can use Gradle to deploy either an Apache http docker or a haproxy docker http://gitlove.us/p/million12/docker-haproxy to do the load balancing to your two appA and appB tomcat containers. You could also use docker for the tomcat containers. You could also use Amazon AWS for two Amazon Linux tomcat servers and either an elastic load balancer or a separate haproxy server for load balancing.

fcnorman
  • 1,154
  • 9
  • 19