wttech / gradle-aem-multi

Example Multi-Module AEM application built by Gradle Build System
https://tech.cognifide.com/tag/gradle-aem-plugin
Apache License 2.0
31 stars 18 forks source link

Support for KnotX in GAP environment plugin #61

Open mierzwid opened 5 years ago

mierzwid commented 5 years ago

@Skejven FYI

gradle-aem-multi setups KnotX service side by side with dispatcher

GAP support:

pun-ky commented 5 years ago

Above is good but one thing missing in my opinion. There need to be set up some custom knotx module in directory knotx/extension/build.gradle (beside of aem/ branch) that will have set up building jar artifact and deployment to the knotx (probably just volume and copying pasting jar to correct place will do the job, vertx is detecting changes / reloads by itself)

pun-ky commented 5 years ago

design results (consulted with @Skejven )

1) knotx volume will point to unversioned directory / under .environment (not aem/gradle/environment as currently) 2) knotx configuration will be grabbed from downloaded distribution file knotx-stack.zip/knotx/conf then unpacked under .environment/knotx/conf then all files could be overridden by aem/gradle/environment/knotx/conf (kinda overlay) 3) on file changes under aem/gradle/environment/knotx/conf they will be copied to target location under volume so that Knotx will use changed file immediately

as a result, only project specific (example) knotx related files are versioned (less to maintain on GAP side), still it will be easy to get all updates from knotx side by bumping knotx-stack.zip version

pun-ky commented 5 years ago

similar design could be applied to built custom Knotx modules however then probably restarting Knotx container will be required (to reflect classpath changes)

malaskowski commented 5 years ago

Another solution for the classpath changes would be approach similar to one from the Knot.x Starter Kit, where custom Docker image is build every time dependencies/modules change. Additionally this approach can be also transferred to prepare production-ready artifacts (Docker way).