Expand my Community achievements bar.

Nomination window for the Adobe Community Advisor Program, Class of 2025, is now open!
SOLVED

Deploy different repositories, at different times on the same AEM cloud instance

Avatar

Level 1

Hello,
I hope you can help me on this topic.
Is there a possibility to deploy on the same environment, different repositories but not all at the same time?
Example:
Suppose we have 2 different repositories (repo A and repo B), totally independent of each other.

Both must be present simultaneously in the same environment
Each repository will have a reference pipeline in which we will deploy the reference code.
What’s the matter?
If I start the pipeline of repository A that contains only repository A,

how can I prevent the build from going to delete everything already present of repository B on the environment?

The goal is to deploy only repositories that have undergone changes, not all repositories but still keep them all on the same environment.

 

Is there a way to implement this?

 

Thanks,

 

Roberta

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi @30991930w169,

I don't think this is possible, what you can try is to:

  • Separate the code in the two repos into different modules and paths so they don't have any conflicts
  • Use the Adobe Git repo to merge/sync the changes from both repos
    • Note that you will need a custom GH Action or similar to achieve this
  • Deploy from the Adobe repo that contains the code from both repos

 

Good luck,

Daniel

View solution in original post

5 Replies

Avatar

Correct answer by
Level 10

Hi @30991930w169,

I don't think this is possible, what you can try is to:

  • Separate the code in the two repos into different modules and paths so they don't have any conflicts
  • Use the Adobe Git repo to merge/sync the changes from both repos
    • Note that you will need a custom GH Action or similar to achieve this
  • Deploy from the Adobe repo that contains the code from both repos

 

Good luck,

Daniel

Avatar

Level 7

In AEM as a Cloud Service, having multiple repositories deployed individually is not feasible. This is because the cloud platform converts everything into a single immutable image as part of the deployment process. 

However, you can achieve modularity and manage multiple codebases by utilizing Git submodules -https://experienceleague.adobe.com/en/docs/experience-manager-cloud-manager/content/managing-code/gi... . With Git submodules, you can include multiple repositories as part of a single main repository. During the build process, all the submodules are combined, ensuring everything is packaged into the final image seamlessly.

This approach allows you to maintain separate repositories for different features or modules while adhering to the single-build deployment requirement in AEM Cloud.

Avatar

Community Advisor

@30991930w169 That is not possible with AEM as cloud service. But you could combine the code in the two repos into a single repo with individual repo code as submodules and then deploy. 

Avatar

Community Advisor

Adding an additional point to what others have mentioned:
In AEM Cloud Manager, you cannot create more than one production pipeline per program. This limitation means you can deploy only one repository to production at a time.

To address this, consider using a merged repository or Git submodules. This setup allows you to deploy all required codebases together consistently using a single pipeline.



Arun Patidar

Avatar

Community Advisor

@30991930w169 

 

Short Answer: We can only deploy one code repository.

 

Why?

This approach, while seemingly restrictive, is actually a fundamental part of AEM Cloud's architecture.

  • Immutable Content: AEM Cloud leverages the principle of immutability, where code is treated as immutable once deployed. Deploying new code effectively creates a new version of the environment, retaining only mutable content (/content, /conf etc). This approach ensures consistency, avoids unexpected behavior due to conflicting changes, and facilitates rollbacks.
  • Deployment Efficiency: A single code repository simplifies deployments. All checks for assuring quality code are evaluated in totality by a pipeline on entire piece of custom code.

 

Solution: Merge the 2 repositories as modules under a parent maven project for deployment. https://www.comwrap.com/en/blog/multi-tenancy-with-adobe-cloud-manager 


Aanchal Sikka