I’m planing to package WAR files as RPMs. Current deployment process just doesn’t work for us and my idea of fixing it would be to create a new Custom Channel in RHN Satellite and publish my WAR files through that Channel. Currently (as we are trying to win some time) I’m managing some config files through Satellite so configs are not a big problem. We don’t keep them in WAR for many reasons but that’s different story.
Anyway, has anyone packaged WAR as RPMs? Do you do hot deployment or do you force JBOSS/Tomcat to restart? Is that After RPM installation or as a part of it? What’s your SPEC file looks like? Can I please see it as an example? Do you check in your SPEC for JBOSS/Java/Oracle client or just install WAR? Any stories to tell? Any major problems?
Should I consider something else?
I can build RPMs no problem but I’d like to hear what’s the best way of doing this with WAR files and JBOSS (some Tomcats are still running here but they will be phased out soon-ish so I’m not too worried about them).
I do appropriate any input.
Thanks in advance
Kind Regards
Chris
I have packaged a WAR file and its companion config file as RPM. My SPEC file checks whether JBoss is running. If it is, the installation exits with an error message, requesting that JBoss be stopped before installation.
In general, it is not a good idea to kill processes or force restart through RPMs. The person in charge of installation should have a separate procedure for doing this.
Other considerations:
1. Does your organization have other installations on the same server?
If so, you might want to standardize on a path under which all installations on the server will go. (For example, /usr/local/bin/myorg/)
It might also help to have a custom *nix user and group, for which file attributes are set for all installations on the server.
2. Do you want a relocatable RPM?
Is there ever a chance that you might want to change the default path for your installation? If so, a relocatable RPM will help.
There are conditions where a relocatable RPM may not work, so check out these things to consider at http://www.rpm.org.
3. Do you want to back up an existing deployment when your RPM runs?
If so, you would need to write that code in your SPEC file.
Here is my complete SPEC file: