Closed pun-ky closed 5 years ago
this calls could be treated as migrations, so that on repository after executing each call we could save that info and later reuse to prevent executing migration again
instead of using dynamically typed groovy it would be better to use *.kts scripts and introducing Kotlin Scripting Console which will work regardless AEM version / Groovy version is very closely bound to AEM version so using it will require regular plugin update to match current AEM version which is not good for that mechanism to work for long time...
Imagine chef like approach
/apps/example/provision/scripts/[cqsm.kts,migration.kts,clean.kts]
aemProvision { // order make precedence as in chef cookbook run lists
script "cqsm'
script "migration', {
runStrategy = 'ONCE'
}
httpRequest { client ->
client.get("/system/console/bundles/restart/[symbolic-name]") // pseudocode
}
script "clean", {
runStrategy { Calendar.getInstance().dayOfWeek == 1 }
}
}
then just imagine
sh gradlew aemBuild aemAwait aemProvision
... so powerful, fully automated (no chef / SE help required)
partially addressed by custom tasks using aem.sync{ it.get("/bin/servlet/xxx) }
; will be improved within 6.0.0
methods to be added to InstanceSync
evalGroovyCode(groovyCode: String)
evalGroovyScript(file: File)
evalGroovyScript(fileNameFilter: String)
// eval all files matching wildcard filter from project.rootProject.file("aem/sync/groovyscripts/$fileNameFilter")
await(options: AwaitAction.() -> Unit)
restart(options: RestartAction.() -> Unit)
download(path: String, target: File)
[start/stop/restart]Bundle(symbolicName: String)
[start/stop/restart]Component(pid: String)
only left
[start/stop/restart]Bundle(symbolicName: String)
[start/stop/restart]Component(pid: String)
implemented as
to be released within 6.0.0
Basing on fact, that there is ability to execute any Groovy Script code via simple HTTP POST request, imagine:
Groovy script related API will require Groovy Console CRX package installed on instance (for instance using
aemSatisfy
) https://github.com/OlsonDigital/aem-groovy-console .