fabric8io / jube

jube is a deprecated pure java implementation of kubernetes. Please look at kansible now instead!
https://github.com/fabric8io/kansible/blob/master/README.md
Apache License 2.0
27 stars 20 forks source link

jube - deploying an app on a tomcat/wildlfy image - Configure web context-path #73

Open davsclaus opened 9 years ago

davsclaus commented 9 years ago

When you have a bunch of WAR(s) to run on a tomcat container, they get assigned their file name as the context path.

I think end users should be able to set some option in their app (eg supported by the fabric8 plugin generating the kubernetes.json) so they can configure this in their maven project.

Then the process manager can ensure the WAR files gets renamed to match the context path. And use name ROOT.war is it should be the root context path.

davsclaus commented 9 years ago

@jstrachan - I think you did this kind of work for the process manager in fabric 1.x.

jstrachan commented 9 years ago

yeah - the way to do this with docker / jube is to have a custom assembly XML file per project. e.g. if you had foo-bar-1.2.3.war and thingy-456.war and you wanted one to be ROOT.war and the other to be cheese.war then the way to specify those is a custom assembly XML file really.

if we can come up with some standard assembly XML files that do common stuff we can push them back into the docker and jube plugins.

e.g. if you have a single WAR dependency thats gonna be a ROOT.war you can use the "rootWar" assembly language reference: https://github.com/rhuss/docker-maven-plugin/blob/master/src/main/resources/assemblies/rootWar.xml

Anything more complex; its probably gonna be most flexible and simple to just let folks hack an assembly XML file in their project - the same file should be reusable for docker and jube I think.

I guess we could maybe try use maven properties to map artifact IDs -> context paths and kinda code generate an assembly XML file? Though that might be more complex than just using an assembly XML :)

jstrachan commented 9 years ago

I wonder if a standard assembly XML could be done for war dependencies which just uses the artifact ID (without the version) as the output file name? That might do for most common 'chuck 5 wars into a tomcat' type use cases?

davsclaus commented 9 years ago

Ah nice with that assembly. But to bad maven is just soo verbose, and 98% of maven users dont know about these additional xml file. They just set dependencies in their pom.xml and add a few plugins.

jstrachan commented 9 years ago

yeah - wonder if there's an easy way to auto-generate it. e.g.

<fabric8.contextPath.myartifactId>/</fabric8.contextPath.myartifactId>
<fabric8.contextPath.anotherArtfactId>/bar</fabric8.contextPath.anotherArtfactId>

it shouldn't be too hard. We just need to be able to generate the assembly.xml file somewhere and for the docker & jube plugins to be able to locate it