valtech / aem-easy-content-upgrade

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

Feature request: "post" script #218

Closed senn closed 11 months ago

senn commented 1 year ago

Similarly to the prechecks mechanism, it would be handy to have a post mechnism that is triggered after a script or after all scripts have finished.

Use case: we for example want to trigger a specific service (once) after all scripts have been executed.

If there is a workaround using the current toolset, please let me know

nhirrle commented 1 year ago

Would it be possible for you to use the always selector? As an example, checkout https://github.com/valtech/aem-easy-content-upgrade/blob/develop/examples-cloud/src/main/content/jcr_root/apps/aecu-scripts/aecu-examples/3_end.always.groovy

senn commented 1 year ago

Our scenario is already using .always scripts. On deploys we execute a lot of .always scripts (in multiple locations) and we’re looking for a way to create a post script that executes after all the rest has finished (or failed).

Are scripts executed in a structured order?Alphabetical by path perhaps? On phone, can’t easily check right now. If so, we could create a ZZZZZ_post.always.groovy.

nhirrle commented 1 year ago

Hi @senn Yes, the scripts in a folder are sorted alphabetically, this is the code doing so: https://github.com/valtech/aem-easy-content-upgrade/blob/b6e323b61e7ef6f5a484ae85b34518fc30a7a2ff/core/src/main/java/de/valtech/aecu/core/service/AecuServiceImpl.java#L125

nhirrle commented 1 year ago

@senn did the naming tip worked for you?

senn commented 1 year ago

@nhirrle Sorry for late reply... holidays 😅 I haven't tested it yet, but I have passed on the suggestion to my colleague

senn commented 11 months ago

Closing this for now. Will re-open if needed.