Real world example

Each enterprise has different requirements including different team setup, processes, and development workflows. The setup described below is used by Adobe for several projects that deliver experiences on top of AEM as a Cloud Service.

For instance, the Adobe Creative Cloud applications, such as Adobe Photoshop or Adobe Illustrator, include content resources such as tutorials, samples, and guides available to their end users. Client applications consume content from AEM as a Cloud Service in a headless manner. They make API calls to the AEM Cloud publish tier to retrieve structured content as JSON streams. Additionally, the Content Delivery Network (CDN) in AEM as a Cloud Service is used to serve both structured and unstructured content with optimal performance.

The teams contributing to this project adhere to the following process.

Each team uses its own development workflow and has a separate Git repository. An additional shared Git repository is used for onboarding projects. This Git repository contains the root structure of Cloud Manager’s Git repository, including the shared Dispatcher configuration.

Onboarding a new project requires listing in the reactor Maven project file at the root of the shared Git repository. For Dispatcher configuration, a new configuration file is created inside the Dispatcher project. The main Dispatcher configuration then includes this file. Each team is responsible for its own Dispatcher configuration file. Changes to the shared Git repository are rare and are usually only required when a new project is onboarded. The main work is done by each project team within their own Git repository.

Workflow diagram

The Git repository for each is set up using the AEM Project Archetype and thus follows the best practices for setting up AEM Projects. The only exception is the Dispatcher configuration, which is done in the shared Git repository as outlined above.

Each team uses a simplified Git workflow with two + N branches, following the Git flow model:

  • A stable release branch contains the production code.

  • A development branch contains the latest development.

  • For each feature, a new branch is created.

Development is done in a feature branch. When the feature matures, it is merged into the development branch. Completed and validated features are picked from the development branch and merged into the stable branch.

All changes are done through PRs (Pull Requests). Quality gates automatically validate each PR. Sonar is used for quality checking the code and a set of test suites is run to ensure that the new code is not introducing any regression.

The setup in the Cloud Manager’s Git repository has two branches.

  • A stable release branch contains the production code from all teams.
  • A development branch contains the development code from all teams.

Every push to a team’s Git repository in either the development or the stable branch triggers a GitHub action.

All projects follow the same setup for the stable branch. A push to the stable branch of a project is automatically pushed to the stable branch in Cloud Manager’s Git repository. A push to the stable branch triggers the production pipeline in Cloud Manager. Each push by any team into a stable branch triggers the production pipeline. The production deployment is updated if all quality gates pass.

Push diagram

Pushes to the development branch are handled differently. A push to a developer branch in a team’s Git repository also triggers a GitHub action. This action automatically pushes the code into the development branch in Cloud Manager’s Git repository. However, this code push does not automatically trigger the non-production pipeline. A call to Cloud Manager’s API triggers it.

Running the production pipeline includes checking the code of all teams via the provided quality gates. After the code is deployed to stage, the tests and audits are run so everything is working as expected. When all gates are passed, the changes are rolled out to production without any interruption or downtime.

For local development, the SDK for AEM as a Cloud Service is used. The SDK allows a local author, publish, and Dispatcher to be set up. This workflow enables offline development and quick turnaround times. Sometimes only the author environment is used for development, but quickly setting up Dispatcher and publish environments allows testing everything locally before pushing into the Git repository.

Members of each team usually checkout the code from the shared Git for their own project code. There is no need to check out other projects because the projects are independent.

Local checkout and SDK

This real-world setup can be used as a blueprint and then customized to the needs of an enterprise. The flexible branching and merging concept of Git allows for variations of the above workflows, customized to every team’s needs. AEM as a Cloud Service supports all these variations without sacrificing the core value of the opinionated Cloud Manager pipeline.

TIP
See Work with Multiple Source Git Repositories to learn more about this setup.