Jenkins deployment on multiple servers with different configurations - deployment

We are using jenkins to build and deploy our project.
Currently we build the project (It's a Spring java application) in one jenkins job and deploy it on our servers in an other jenkins job. The result of the build job is a war file which gets build and deployed by maven to tomcat.
This worked really well till we came to the point that we needed different configuration files (spring applicationContext.xml) for the application depending on which server the application is deployed. The configuration file comes packed in the war file from the build job.
What would be a good way to modify the build process for two servers with two configuration files? Is there a way to avoid having two builds just because we need two different configuration files in the war files?
Thanks for your help!

I supply the configuration files, per environment, at the time of deployment.
It overwrites whatever is there as part of .war

Related

How to deploy two war files onto Jboss 6.4.0

I have two war files msg-producer and msg-consumer. How to deploy these two war files onto jboss 6.4.0 simultaneously?
currently deploying one war file like this:
copy war file into EAP\standalone\deployments folder
Run standalone.bat from EAP-6.4.0\bin.
Yes, you can deploy two or multiple WAR files into EAP\standalone\deployments folder.
Each web application will have a different context root, using context root you can access the application.
Yes, You can deploy two or more WAR/EAR files in the JBoss Application server.
Please go through the $JBOSS_ROOT/standalone/deployments/README.txt
There are two different modes 1. auto-deploy mode and 2. manual deploy mode
Manual deployment relies on a system of marker
files, with the user's addition or removal of a marker file serving as a sort
of command telling the scanner to deploy, undeploy or redeploy content.
Auto-deploy mode: The scanner will directly monitor the deployment content,
automatically deploying new content and redeploying content whose timestamp
has changed.
Read the README.txt for more details.
The simplest way I recommend is
Login the JBoss admin console
Under deployments tab, click on "add" and select the required msg-producer and msg-consumer war files. "Enable" checkbox to be selected.
Access the application http://localhost(or_servername):8080/contextroot/

Deploy multiple wars to multiple remote containers through Jenkins job

Hi I'm using Jenkins to build and deploy to remote container. As of now my maven job build 5 webapps through one parent pom and deploy all wars into one remote container.
As of now I'm using deploy plugin which is allowing to deploy a war to single remote container.
Now I wanted to put each war into a different remote container. Please let me know any plugins available or any scripts to use to specify where to deploy each war file.
Thanks
You can write an ant script for this purpose. Tomcat manager plugin can be controlled through Ant, so you can write five different tasks for your 5 different servers. You can add this ant script as a post build task.
Thanks
Param

WAS related files getting packaged in ear

I have got an ear file to deploy on WAS. In the ear file, I see the war file, the jar files and other static stuff. But I also see files like variales.xml,security.xml and deployment.xml although the ant build script did not generate these files.
Where did these extra files come from? What purpose do they serve?
These files are part of a feature known as Enhanced EARs. See the WebSphere Application Server V7: Packaging Applications for Deployment redbook for more information. In short, application-specific configuration can be included in the application to minimize the per-server configuration that an administrator must perform when installing an application.

Exporting RCP as a product

I am deploying my eclipse rcp product into some folder say C:\deploy\eclipse.
But
Here i am facing a problem,while i was exporting to the same location it says export failed,
Since my project is in development stage each time i do changes in the code,i need to deploy to perform unit testing its pretty time consuming.All that i want to achieve is just override the same deployed location, i don't know if it is possible? The current approach was just go and delete the currently deployed folder and then export again, this is odd i guess, can someone drive me in a better approach
I suggest to setup a headless build which means that you're able to trigger a build of your RCP application from the commandline. Once you've established a headless build you can write some sort of batch file which for example cleans up the deployment directory before the build.
You can integrate this batch file in your Eclipse IDE via External Tools.
Here is a tutorial on how to setup a headless build.

Deploying only changed portions of a war to Tomcat

I'm deploying my application to Tomcat, which currently involves uploading a ~40MB war file to a remote server.
Often the changes within the war only affect jars and static content which account for maybe 2 - 3MB's. Is there some tooling I can integrate with my Ant script that can accurately detect the changes to the war and give me a smaller subset to upload?
I ended up writing an ant task to copy the relevant portions of the app, zip them up and deploy them on the server.
Simple, but effective.