Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Deployment and Versioning Best Practices

Avatar

Level 2

First a little background, then several questions below.  I am a recent convert from the .NET world, so I am still picking up on AEM, Java, Maven, etc.  We are using 6.3 and created our project solution using archetype 12.  Most development is happening on local workstations between AEM and Eclipse.  The source is being stored in a GitHub repo.  We have Jenkins set up in our development environment which nightly builds and deploys the solution to our test AEM environment.  The stage and production environments sit in a different lab environment that we can not connect into remotely.

1. Right now when we want to deploy a release to the stage environment we send the latest core JAR as well as the latest ui.app zip and ui.content zip.  The team installs the jar in both author and publish using the web console and then uploads/installs the two zips through the crx package manager on author and replicates them to publish. 

     a.  Is this the right way to deploy these builds to a separate environment?  It seems like there should be an easier way, but maybe this is correct.  I noticed that the ui.content zip contains a reference to the jar as if it would install that when uploaded/installed through package manager, but when I tested that theory it did not update the pre-existing JAR with the new version.  This could be because of the SNAPSHOT versioning we are using (discussed below), not sure.

     b. Is there a way to deploy everything in one package?  If I could get the zip to install the jar is there a way to get it to install the ui.apps zip too or would I need to change the organization of the solution somehow?

     c. Is manually installing these the right way they should go about it or is there a better alternative though scripting? 

2. Along the way developing we discovered the jars were not being updated during deployments.  After doing some reading we changed all the versions to include -SNAPSHOT in the pom files and this fixed that issue.  However, not having versions in stage/prod of the packages seems wrong.

     a.  Whats the best way to handle development vs stage/prod systems?  Should Jenkins be changing the versions or is it typically done manually when you want to deploy a good build and then re-built?

     b.  If/When you change the version does it require udpates to all the POM files?  I noticed some reference others by version number.

     c. Is there a script or something in Maven that can update the version that I am un-aware of?

Thanks,

Doug

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi Doug,

I hope this can help you somehow-

1. If you install ui.app.zip , it will automatically install the bundle JARs unitl you didn't set in filter mode in filter.xml. and with publication same Jar would go on Publisher as well, I think you can avoid manual installation of Jars for web console if you are deploying your bundle JARs.

1.a Yes, this is a correct way to deploy code using ui.apps.zip and content using ui.content.zip

You can merge both though but not a best practice to deploy content and code together, if some issue with either code or content you may need to rollback everything.so keep two package instead. ui.app.zip have the references of JAR as bundle JAR installed inside /apps/yourProject/install/

1.b Yes you can if your bundle is getting packed inside ui.apps.zip after maven build.or you can do it with maven copy plugin if you need other files to be there inside apps.zip

1.c for deploying packages you can use Curl.

https://hashimkhan.in/aem-adobecq5-code-templates/curl-aem-commands/

List of common AEM cURL commands

http://www.cqtutorial.com/courses/cq-admin/cq-admin-lessons/cq-maintenance/cq-package-manager

2. You can use minor and major for the versioning. if Package is ready to go to Prod upgrade Major for stage you can increment Minor.

2.a For Jenkins to handle the dev vs Prod; use two different branch. One is for Dev and another is for Prod. Dev branch can point to current release and Prod one can point to previous release. whenever current release is deployed to Prod. point current branch to Prod and create new branch with next version for dev.

2.b Yes you need to update POM version in all the module's POM, i.e. all the child POM along with Parent POM

2.c For version increment

Google Code Archive - Long-term storage for Google Code Project Hosting.

Increment versions with the Maven Build Helper and the Versions Plugin - codecentric AG Blog

Thank

Arun

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Hi Doug,

I hope this can help you somehow-

1. If you install ui.app.zip , it will automatically install the bundle JARs unitl you didn't set in filter mode in filter.xml. and with publication same Jar would go on Publisher as well, I think you can avoid manual installation of Jars for web console if you are deploying your bundle JARs.

1.a Yes, this is a correct way to deploy code using ui.apps.zip and content using ui.content.zip

You can merge both though but not a best practice to deploy content and code together, if some issue with either code or content you may need to rollback everything.so keep two package instead. ui.app.zip have the references of JAR as bundle JAR installed inside /apps/yourProject/install/

1.b Yes you can if your bundle is getting packed inside ui.apps.zip after maven build.or you can do it with maven copy plugin if you need other files to be there inside apps.zip

1.c for deploying packages you can use Curl.

https://hashimkhan.in/aem-adobecq5-code-templates/curl-aem-commands/

List of common AEM cURL commands

http://www.cqtutorial.com/courses/cq-admin/cq-admin-lessons/cq-maintenance/cq-package-manager

2. You can use minor and major for the versioning. if Package is ready to go to Prod upgrade Major for stage you can increment Minor.

2.a For Jenkins to handle the dev vs Prod; use two different branch. One is for Dev and another is for Prod. Dev branch can point to current release and Prod one can point to previous release. whenever current release is deployed to Prod. point current branch to Prod and create new branch with next version for dev.

2.b Yes you need to update POM version in all the module's POM, i.e. all the child POM along with Parent POM

2.c For version increment

Google Code Archive - Long-term storage for Google Code Project Hosting.

Increment versions with the Maven Build Helper and the Versions Plugin - codecentric AG Blog

Thank

Arun