valtech / aem-easy-content-upgrade

AEM Easy Content Upgrade simplifies content migrations in AEM projects
Other
61 stars 26 forks source link

Ensure installation order #133

Closed kwin closed 3 years ago

kwin commented 4 years ago

For the first time execution of packages relying on the install hook it is crucial that the bundle providing the hook is already running. How can I work with package dependencies and other means so that everything can be packaged together in one big container package:

  1. AECU package
  2. Groovy Console package
  3. Content Migration package with install hook

Could you provide an example for that?

gruberrolandvaltech commented 4 years ago

Recommendation is to separate this in two deployment packages to avoid issues with AECU being not yet installed at all. How do you achieve this for AC Tool? We have waitForOsgiEventsQuietInSec on ui.apps if this is what you are looking for.

kwin commented 4 years ago

You should be able to use a combination of a) package dependencies (enforcing the right order of sub package installations) and b) https://sling.apache.org/documentation/bundles/installer-provider-installhook.html to synchronously deploy the necessary bundles with the package

gruberrolandvaltech commented 4 years ago

Then it should work when you set the package dependencies.

kwin commented 4 years ago

Package dependencies are not enough as the contained bundles are being picked up asynchronously by the JCR Installer Provider. If you would provide an AECU package leveraging https://sling.apache.org/documentation/bundles/installer-provider-installhook.html which contains all relevant bundles (i.e. its own as well as the one from the Groovyconsole) it should be possible though.

gruberrolandvaltech commented 4 years ago

We have <installPathRegex>/apps/valtech/aecu/(config|install)/.*</installPathRegex> Does it help if you install AECU bundle that contains Groovy Console?

  1. AECU Bundle package
  2. Content Migration package with install hook
kwin commented 4 years ago

We have <installPathRegex>/apps/valtech/aecu/(config|install)/.*</installPathRegex>

That is nice, but won't help for Groovyconsole itself. I think right now using the hook is quite useless as the downstream dependency is not deployed synchronously!

Does it help if you install AECU bundle that contains Groovy Console?

No, as the problem is the bundle from the Groovyconsole which is started too late.

I think what would be good is to repackage the Groovy Console in a way that the bundle is synchronously deployed.

gruberrolandvaltech commented 4 years ago

I can check this after my vacation. Please leave a comment/PR if you have a solution. If it requires work on GroovyConsole side then it makes sense to file a PR there. They are quite constructive.

gruberrolandvaltech commented 3 years ago

Added dependency on Groovy Console. Repackaging the Groovy Console is no option for the moment.