Swiss army knife for Adobe Experience Manager related automation. Environment setup & incremental AEM application build which takes seconds, not minutes.
#943
Tested with: https://github.com/adobe/aem-project-archetype/releases/tag/aem-project-archetype-39 GAP launcher should scaffold properly Gradle build files correctly with
aemVersion=cloud
aemVersion=6.5.13
(6.5.14
does not work as there is no uber-jar published here)See: https://github.com/wttech/gradle-config-plugin
To setup or upgrade AEM SDK now it is needed to only change reference to the recent AEM SDK ZIP archive. GAP will automatically unpack it then GEP could load automatically and use dispatcher AEM Dispatcher Ethos Docker image. GAP will determine valid image file included in AEM SDK even when using Mac M1 laptops with Rosetta emulation. It is because AEM instances should be rather running on x86_64 Java rather on arm64 because not all AEM features are working on Java for ARM (e.g Scene7 seems that it is not working).
Since now, a new property distUrl
accepts both AEM SDK ZIP and AEM On-prem JAR to be able to setup instances:
localInstance.quickstart.distUrl=/home/john-doe/aem/aem-sdk-quickstart-2022.7.8005.zip
or
localInstance.quickstart.distUrl=/home/john-doe/aem/cq-quickstart-6.5.0.jar
To upgrade local environment it is needed only to update this single property and resetup everything by using command:
gradlew instanceResetup -Pforce
Now GAP could use Adobe IMS to connect to AEMaaCS author instance.
Content synchronization features, accessing repository in AEM DSL scripting using Repository
instance service is now available.
Since now it is possible to implement e.g. migration tasks that are grabbing content from an on-prem instance and deploying it on a cloud instance.
tasks.register("migrate") {
doLast {
val author1 = aem.instance("http://<username>:<password>@localhost:4502")
val author2 = aem.instance("https://<author-name>.adobeaemcloud.com")
author2.serviceCredentials.set(File("/path/to/service_token.json"))
val pkg = author1.sync.packageManager.download {
filters("/content/foo")
}
author2.sync.packageManager.deploy(pkg)
}
}
To simplify passing environment variables and secret files, GAP now consider VCS-ignored dirs to grab override files from. Also it will pass env vars to AEM process automatically when env var files is created at approriate location. Addresses things described here.
It is also possible to configure env vars passed to AEM process via DSL:
aem {
localInstance {
defined {
envVars.put("AIO_...", "foo")
envPass("AIO_*")
}
}
}
The env vars per particular type of instances could be put under:
env/.gradle/aem/localInstance/override/[common|author|publish]/env.properties
env/src/aem/localInstance/override/[common|author|publish]//env.properties
To setup secrets, consider adding file at path 'env/src/aem/localInstance/override/common/crx-quickstart/conf/sling.properties' with following content:
org.apache.felix.configadmin.plugin.interpolation.secretsdir=${sling.home}/secret
Then for each secret create a file at path following pattern env/src/aem/localInstance/override/common/crx-quickstart/secret/${ENV_VAR_NAME}
replace ${ENV_VAR_NAME}
with your own env var name e.g AIO_RUNTIME_XXX
. Be sure to set file name which is exactly the same as environment variable name (typically all uppercase) without extension. Put the value of environment secret as file content.
Related changes: https://github.com/wttech/gradle-aem-plugin/pull/936/files
When instance cannot be started properly since now GAP will display automatically last 30 lines of stdout.log.
Since now it is easy to configure OpenTelemetry, Jacoco or any other Java Agent within single line of code.
aem {
localInstance {
defined {
jvmAgents {
openTelemetry()
}
}
}
}
Now it is super easy to execute workflow for any resource from CLI. Read more here: https://github.com/wttech/gradle-aem-plugin/blob/master/docs/instance-plugin.md#task-instanceworkflow
Instance
object now uses Gradle Provider API properties instead of raw values. To read these values in build scripts now it is required to supplement a usage of each property with.get()
.
Other notable changes:
Instance.physicalType
renamed to Instance.location
Instance.id
renamed to Instance.purposeId
Instance.type
renamed to Instance.purpose
Now environment variables could be used to override Gradle properties, see: https://github.com/wttech/gradle-common-plugin/pull/16
Prefix is added to straightforwardly indicate that artifact is built using Maven under the hood:
zip
-> mvnZip
pom
-> mvnPom
jar
-> mvnJar
Also alignment is done of origin GAP tasks names with the Maven build task names:
deploy
-> packageDeploy
deployAll
-> packageDeployAll
cleanAll
-> packageCleanAll
sync
-> packageSync
config
-> packageConfig