AEM Code Promotion and Content Synchronization Best Practices

Similar documents
platform Development Process Optimization For Drupal centric projects

Benefits and Challenges There are many challenges to implementing a multi-tenant environment. These include:

Seven Habits of Highly Effective Jenkins Users

Continuous Delivery of your infrastructure. Christophe

Who Moved My Module? 1

CONTINUOUS DELIVERY IN THE ORACLE CLOUD

WHITEPAPER. Database DevOps with the Redgate Deployment Suite for Oracle

JenkinsPipelineUnit. Test your Continuous Delivery Pipeline. Ozan Gunalp - Emmanuel Quincerot

ThinkPalm s BreakThrough DevOps Capabilities ThinkPalm

TM DevOps Use Case TechMinfy All Rights Reserved

Automated Testing of Tableau Dashboards

What is version control? (discuss) Who has used version control? Favorite VCS? Uses of version control (read)

Chapter 1 - Continuous Delivery and the Jenkins Pipeline

Your Engineering Excellency

Snapshot Best Practices: Continuous Integration

How Can Testing Teams Play a Key Role in DevOps Adoption?

White Paper(Draft) Continuous Integration/Delivery/Deployment in Next Generation Data Integration

The Actual Real World at EclipseCon/ALM

ONAP Developer Typical Setup 2017 July ONAP Virtual Developers Event

Adobe Experience Manager Dev/Ops Engineer Adobe Certified Expert Exam Guide. Exam number: 9A0-397

Jenkins: A complete solution. From Continuous Integration to Continuous Delivery For HSBC

Jenkins User Conference Israel. #jenkinsconf. CI / Liveperson. Gidi Samuels. July 16, #jenkinsconf

Sample Exam. Advanced Test Automation - Engineer

Super Charge Your Continuous Integration Deployments. Nikola Gotsev April 26, 2016

A deployment pipeline composed of steps from remote servers

Team Foundation Consulting. Training. Team Member Training User training designed to cater for specific roles within your team. Developer TFVC / Git

Content Deployment Instructions Sharepoint 2010 Incremental

Adobe Experience Manager

Version control CSE 403

Seven Habits of Highly Effective Jenkins Users. Andrew Bayer Cloudera OSCON Java 2011

JetBrains TeamCity Comparison

How Do I Manage Multiple Versions of my BI Implementation?

LEVERAGING VISUAL STUDIO TEAM SYSTEM 2008 Course LTS08: Five days; Instructor-Led Course Syllabus

OTC Tools Development and Release process. Igor Stoppa & Eduard Bartosh & JF Ding V May 2013

Test Automation Strategies in Continuous Delivery. Nandan Shinde Test Automation Architect (Tech CoE) Cognizant Technology Solutions

Dr. Jenkins, M.D., at Your Service: An overview of Jenkins at. #jenkinsconf. Cerner Corporation. Jenkins User Conference San Francisco

Review Version Control Concepts

DevOps Course Content

SAME SAME, BUT BETTER Comparing Artifactory to Other Binary Repository Managers

9 Reasons To Use a Binary Repository for Front-End Development with Bower

The Salesforce Migration Playbook

TM DevOps Use Case. 2017TechMinfy All Rights Reserved

Continuous integration for databases using Red Gate tools

Continuous Integration using Docker & Jenkins

Jenkins: AMPLab s Friendly Butler. He will build your projects so you don t have to!

UPGRADING IMIS NEWLIN

Pipeline as Code for your IAC. Kris

USING ARTIFACTORY TO MANAGE BINARIES ACROSS MULTI-SITE TOPOLOGIES

FUNCTIONAL BEST PRACTICES ORACLE USER PRODUCTIVITY KIT

WhatsConfigured v3.1 User Guide

Con. Continuous Integration

Turbo boost your digital app test automation with Jenkins

Version control CSE 403

Sonatype CLM Enforcement Points - Nexus. Sonatype CLM Enforcement Points - Nexus

Version control CSE 403

How to Build an Appium Continuous Testing Pipeline

Distributed CI: Scaling Jenkins on Mesos and Marathon. Roger Ignazio Puppet Labs, Inc. MesosCon 2015 Seattle, WA

How can you implement this through a script that a scheduling daemon runs daily on the application servers?

TDF Infra Overview. from developers' perspective

DEVOPSIFYING NETWORK SECURITY. An AlgoSec Technical Whitepaper

PHP Composer 9 Benefits of Using a Binary Repository Manager

Development Lifecycle Guide

ARES: AUTOMATIC RELEASE SERVICE

Upgrading to UrbanCode Deploy 7

TM DevOps Use Case. 2017TechMinfy All Rights Reserved

High Availability- Disaster Recovery 101

CASE STUDY IT. Albumprinter Adopting Redgate DLM

Planning and Administering SharePoint 2016

PayPal Delivers World Class Customer Service, Worldwide

High Availability- Disaster Recovery 101

Jenkins Inside Google

Utilizing Fast Testing to Transform Java Development into an Agile, Quick Release, Low Risk Process

We are ready to serve Latest Testing Trends, Are you ready to learn?? New Batches Info

DevOps Made Easy. Shireesh Thanneru, Platform Architect. Intel. Linoy Alexander, Director, DevOps

Reducing Costs and Improving Systems Management with Hyper-V and System Center Operations Manager

Continuous Integration and Delivery with Spinnaker

Sunil Shah SECURE, FLEXIBLE CONTINUOUS DELIVERY PIPELINES WITH GITLAB AND DC/OS Mesosphere, Inc. All Rights Reserved.

AMM Feb/2018. Frederic Marec Embedded Engineer

Developing and Testing Java Microservices on Docker. Todd Fasullo Dir. Engineering

Privileged Remote Access Failover Configuration

ITBraindumps. Latest IT Braindumps study guide

Advanced Technologies of SharePoint 2016

Sonatype CLM - Release Notes. Sonatype CLM - Release Notes

Advanced Technologies of SharePoint 2016

Achieving Continuous Delivery - Micro Services. - Vikram Gadang

REASONS TO USE A BINARY REPOSITORY MANAGER WHEN DEVELOPING WITH. White Paper

VMware vrealize Code Stream Reference Architecture. 12 APRIL 2018 vrealize Code Stream 2.4

Continuous Integration Ensemble / HealthShare Health Connect

Version Control for PL/SQL

NetApp Jenkins Plugin Documentation

The Rock branching strategy is based on the Git Branching Model documented by Vincent Driessen.

Fundamentals of Git 1

#jenkinsconf. Managing jenkins with multiple components project. Jenkins User Conference Israel. Presenter Name Ohad Basan

XD Framework (XDF) Overview. For More Information Contact BlueSpace at Tel: (512) Web:

Break Through Your Software Development Challenges with Microsoft Visual Studio 2008

Building Backup-to-Disk and Disaster Recovery Solutions with the ReadyDATA 5200

Developing Microsoft Azure Solutions (70-532) Syllabus

Advanced Continuous Delivery Strategies for Containerized Applications Using DC/OS

SharePoint Development Web Development Generate from Usage. Cloud Development Windows Development Office Development

Liquibase Version Control For Your Schema. Nathan Voxland April 3,

Transcription:

AEM Code Promotion and Content Synchronization Best Practices Ian Reasor, Technical Architect, Adobe Partner Experience Introduction When considering the movement of content through environments in an AEM topology, we need to look at it from two perspectives. The code that is running a website will start on a developer s local sandbox and be promoted through the integration and test environments, eventually ending up in production. Conversely, the content that is being authored for the website will be created in production and be synchronized to these same staging and test environments. This same code/content flow applies to implementations of AEM Assets and AEM Forms. This document outlines some best practices for promoting code from developers workstations up to the production environment as well as keeping content in sync throughout your AEM environments. There are many options for synchronizing content between environments, so we will look into each of them and weigh their pros and cons.

Recommended Environment Topology In an ideal scenario, Adobe recommends the use of five distinct environments for code promotion and testing. These environments are listed below along with their purposes. Developer Local Sandbox these environments run locally on a developer s workstation and allow for testing and debugging as part of the development process. Development Integration an environment for automated build deployment and execution of integration tests. QA an environment where code can be continuously tested. This is where the QA team will perform the bulk of their validation testing. Staging/UAT an environment where a build candidate can be deployed for user acceptance testing as well as security and performance testing. The hardware on this environment should match production as closely as possible. Production the live environment where the website is authored and served from. Promoting Code Through Environments As code changes are made, the build will be promoted through each of these environments, encountering checkpoints along the way. These checkpoints allow us to ensure that the staging environment is stable enough for the end users while enabling the developers and QEs to move fast and break things. The process can be visualized as such:

Code Branches To support concurrent activities such as applying hotfixes to the production environment, fixing bugs discovered during user acceptance testing, and active development on a future release, we recommend using a Git-based repository along with the Gitflow system for branching and merging. Read more about Gitflow at http://nvie.com/posts/a-successful-git-branching-model/. In general, code that lives on developers local sandboxes is checked into feature branches. When code is ready for deployment to the development integration and QA environments, it is first merged into the develop branch, often by using a pull request. When code is to be deployed to staging, it will be branched into a release branch, and the version will be set to a non-snapshot release version before deployment to the environment. When code is ready to be deployed to production, it will be merged into master. This allows us to always have a branch of the code that is currently live on the site, no matter where we are in the development process. Continuous Integration We recommend the use of a continuous integration 1 (CI) solution when building and deploying your AEM project. Not only does using a system such as Jenkins or TravisCI make your build process easily repeatable and testable, but with AEM s Maven-centric approach, it is easy to implement as well. The small amount of time invested up front to configure continuous integration will pay for itself in saved time doing deployments over the course of a project. For most projects, we recommend the following jobs: Push to Dev This job polls the source code repository, and whenever a new check-in is detected, it will download the latest code, compile it, run unit tests, run static code analysis, deploy to the dev integration environment, and run the automated integration tests on it. Push to QA This job can be executed by the QE team when they desire a new build to perform testing on. It will take the last successful build from the push to dev job and deploy it to the QA environment. Push to Staging This job is executed by an administrator when a build is ready for User Acceptance Testing. The job will pull down the release branch specified by the administrator at run time, build it, run unit tests, and deploy it to the Staging environment. Content Refresh Depending on the content synchronization method chosen, jobs are sometimes implemented to run scripts that enable content synchronization from production to lower environments. It is possible to create a CI job that can perform production deployments, but this job would be more complex than these other examples. This is due to the need to deploy to some of the servers in the environment and validate the deployment before deploying to the rest of the environment. That being said, scripting out deployments, especially production ones, is widely considered to be a best practice as it eliminates the risk of user error during the process. 1 https://solutionpartners.adobe.com/content/dam/spp_assets/public/public_4/continuous_integration_f or_aem.pdf

For teams that have mature CI adoption practices, they may consider using Jenkins Pipelines to fully automate a Continuous Delivery process. For more information on Jenkins Pipelines, see https://jenkins.io/doc/book/pipeline/. Static Code Analysis We recommend implementing a static code analysis tool to ensure that code quality remains consistent over time and potential errors can be caught early. SonarQube (https://www.sonarqube.org/) is a popular option that offers a free version. Cognifide offers AEM Rules for SonarQube (https://github.com/cognifide/aem-rules-for-sonarqube) that can extend SonarQube s default scanning rules for some common AEM patterns. Repository Management In instances where build artifacts need to be reused across multiple projects or have different versions maintained for later use, a repository manager can be helpful. These can be integrated directly into the build process so that release artifacts and even snapshots can be stored and used in future Maven builds and CI jobs. The most popular repositories on the market are Artifactory 2 and Nexus 3, but there are many options available. Rolling Production Deployments Before an implementation has been brought live, deploying to production is the same as deploying to any other environment. Since end users are not yet accessing the servers, we can push out code and author content at whatever pace is convenient and start sending traffic to the servers when we think that the environment is ready. However, when the environment is already a live environment, there are additional factors that must be considered to ensure continued operation of the website during the deployment. For the sake of simplicity in this discussion, we will illustrate these concepts using a common deployment scenario of one author server with two publish servers and two dispatchers, behind a load balancer. 2 https://www.jfrog.com/artifactory/ 3 https://www.sonatype.com/nexus-repository-sonatype

Phase 1 Normal Operating Conditions In our normal running configuration, the load balancer is splitting traffic between dispatchers 1 and 2. Each of these dispatchers communicates with a single publish instance. The author is pushing content to both publish servers. Phase 2 Internal Deployment During the first phase of the deployment, Dispatcher 1 is removed from the load balancer pool and the replication agent for Publisher 2 is disabled on the author instance. At this point, users of the website will only be served content from Dispatcher 2 and Publisher 2. We then deploy our code changes to the author instance and Publisher 1. Users can then test the website via an internal-only URL to Dispatcher 1 and validate functionality.

Phase 3 Deployment Completion At this point, we can switch the load balancer over to serve live traffic from Dispatcher 1 and remove Dispatcher 2 from the pool while we upgrade Publisher 2. The replication agent on the author can also be re-enabled. Once the testers have validated that Dispatcher 2 is working properly, we add it back to the pool and our deployment is complete. Content Synchronization Many approaches can be taken to synchronize content from production environments to lower environments. One thing is clear, though: for accurate testing to be performed on code changes, it is imperative that tests are run on production-like content. For this reason, we highly recommend that a content synchronization process is defined and adhered to on a regular schedule. The methods below are several that we have seen our clients be successful with in the past. The best approach for any given client will vary based on how often their content is updated and the size of their repository. In all of the cases listed below, we are assuming data synchronization from a production author to a lower author environment. Once the content has been copied into the author environment, replication should take place in the lower environment for use on the lower environment s publish instance. Backup/Restore The simplest approach to synchronizing content between instances is to take a backup of the production author instance and restore it to the lower environment. Once the restore is complete, update the lower instance s configurations to ensure that it does not interact with other production environments such as publish instances, translation vendors, or other Adobe Experience Cloud solutions. Common areas for configuration include replication agents and web service endpoints. As an added layer of protection, it is best to set up the network topology such that the lower authoring environment cannot replicate to the production publish servers. Pros: Relatively straightforward Allows for constant testing of the backup/restore processes Ensures that all content and configurations are included

Cons: Because the entire repository is being moved, the size of the content being moved is larger than necessary. Updating configurations after restoring the backup is a manual step and thus error-prone. The lower environment must be brought offline during the restore operation. Content Packages For customers who have a small amount of data that will need to be synchronized, content packages can sometimes be employed. We first create a content package on the production author environment with the filter configured for the authored content that we wish to synchronize. After building and downloading the package, it can then be uploaded and installed in any lower environments. Pros: Straightforward approach Package definitions allow us to pick and choose which content to refresh Only the needed content is copied over Cons: Only useful for situations in which there is a small amount of content to synchronize as content packages can be unwieldy when they are more than a couple GB in size.

VLT-RCP Many developers are familiar with FileVault (VLT) as a method of synchronizing changes between the JCR and their local filesystem. VLT also includes the option to synchronize changes over RCP. Either through the vlt command line or through the vlt-rcp UI tool, content can be extracted from the production instance and copied into a lower environment. Since this does put some load on the resources of the servers involved, when using this approach, it is recommended to copy from production to staging and then from staging to QA, etc. This will prevent an unnecessary load from being placed on the production author environment. The VLT-RCP UI is included in the ACS AEM Tools project 4. Instructions on running the tool from the command line are available in the Jackrabbit documentation 5. Pros: Works well for large amounts of content Only specified content paths are copied over Cons: Can be time consuming Replication The final recommended approach involves adding a replication agent to the production author instance to replicate content to the staging author. This setup can be repeated in lower environments, with the staging author replicating to the QA author, etc. All content replicated on the production author will automatically be pushed to the staging author. Pass-through replication can be configured to automatically activate this content to the staging publish instances and lower environments. Note that when using this method, only activated content will be synchronized to lower environments. Pros: Only updated content is copied over. Content is copied as it is activated in production rather than in batches. Cons: Adding a replication agent on the production author increases the overhead required to publish content. 4 https://adobe-consulting-services.github.io/acs-aem-tools/features/vlt-rcp/index.html 5 http://jackrabbit.apache.org/filevault/rcp.html

Content Sync Method Comparison These various synchronization methods are laid out in the following table to allow for easier comparison of the various benefits that they each offer: Easy to implement Allows testing existing processes Ensures all content is included Allows for selective content synchronization Appropriate for large amounts of content Backup/Restore X X X X Content X X Packages VLT-RCP X X Content activated as it is updated Replication X X X You can also reference the following decision tree when selecting the right content synchronization method for your use cases: