There are many ways for deploying new releases to AEM staging and Production environments. In this tutorial, I will share with you my process for deploying new releases manually. I personally found this the safer way to deploy new releases because you can easily roll back versions, and you let AEM’s out of the box replicate agents transport new changes to your production publish environments.
Scenarios
- Scenario 1: You are ready to make a release on Staging
- Scenario 2: You are ready to make a new release on Production
Scenario 1: You are ready to make a new release on Staging
- Change the project version in maven(remove SNAPSHOT, because SNAPSHOT packages are only for development).
1
2
3
4// documentation: http://www.mojohaus.org/versions-maven-plugin/examples/set.html
// updates project version to 1.2.0 (remove "SNAPSHOT", and don't commit version)
mvn versions:set -DnewVersion=1.2.0
mvn versions:commit - Build your project to your local machine.
1
2
3<code lang="java">
// builds your maven project into target without installing packages on AEM
mvn clean install -Padobe-public// output ui.apps in /ui.apps/target/{projectName}.ui.apps-x.x.x.zip
// output ui.content in /ui.content/target/{projectName}.ui.content-x.x.x.zip - Upload the build (/ui.apps/target/{projectName}.ui.apps-x.x.x.zip) into “Staging Author”, package manager.
- Upload the build (/ui.content/target/{projectName}.ui.content-x.x.x.zip) into “Staging Author”, package manager.
- Replicate {projectName}.ui.apps-x.x.x.zip to Staging Publish. Replicating this package will ensure that all your publish instances will be up to date; all files are overwritten.
- Do not replicate ui.content because unpublished pages will all be replicated to your publish instance. You can activate pages in the author instance at your desire.
- Done.
Scenario 2: You are ready to make a new release on Production
Your updates on the staging environment have been approved, and now we want to deploy a new release on to production; the version of your packages should be the same version as your approved staging packages.
- Change the project version in maven(remove SNAPSHOT because SNAPSHOT packages are only for development).
1
2
3
4// documentation: http://www.mojohaus.org/versions-maven-plugin/examples/set.html
// updates project version to 1.2.0 (remove "SNAPSHOT", and don't commit version)
mvn versions:set -DnewVersion=1.2.0
mvn versions:commit - Build your project to your local machine.
1
2
3<code lang="java">
// builds your maven project into target without installing packages on AEM
mvn clean install -Padobe-public// output ui.apps in /ui.apps/target/{projectName}.ui.apps-x.x.x.zip
// output ui.content in /ui.content/target/{projectName}.ui.content-x.x.x.zip - Upload the build (/ui.apps/target/{projectName}.ui.apps-x.x.x.zip) into “Production Author”, package manager.
- Upload the build (/ui.content/target/{projectName}.ui.content-x.x.x.zip) into “Production Author”, package manager.
- Replicate {projectName}.ui.apps-x.x.x.zip to Production Publish. Replicating this package will ensure that all your publish instances will be up to date; all files are overwritten.
- Do not replicate ui.content because unpublished pages will all be replicated to your publish instance. You can activate pages in the author instance at your desire.
- Check-in your code to master (and request for a pull request) with the “SNAPSHOT” label removed in your .pom file.
- Tag your master with v1.2.0 (or whichever version you are working on)
Final Notes
There are many ways of deploying new releases to your AEM Staging or Production environments, but this is my take on this for a manual release strategy. Please leave a comment if you have any questions or suggestions on how I can improve me “package manager oriented way of deploying my releases”.
good!
For # 5, how does one exactly “replicate {projectName}.ui.apps-x.x.x.zip to Production Publish?”
Can you provide the exact steps? Is this done through CRX/DE screens?
Hi Tina,
In the package manager, once you upload the {projectName}.ui.apps-x.x.x.zip, you will see the install button. Click on the install button to install it into the author. Next, after when it is done installing, you can click on the drop-down button to find the “replicate” button. Click on the replicate button, and it will be replicated to the publishers. Please make sure your replication agents are configured as expected.