Bring Your Own Git

Edge Delivery Services recommends using GitHub or GitHub Enterprise Cloud to host and deploy project code for frictionless adoption and seamless integration. If you are already an AEM customer and your organization is unable or unwilling to use GitHub for the source code, you can now use Cloud Manager as an intermediary and configure your own git based repository service there.

The following git based repository services are supported in all 3 flavors: on-premise, public cloud or private cloud:

1. Configure your External Repository in Cloud Manager

As a first step, configure your external repository in Cloud Manager. If you are new to AEM, see here for an introduction and to find out how to access Cloud Manager.

Once the repository ownership is confirmed and the status is set to ready, you will need to set up a webhook for your git repository. This will allow Cloud Manager to receive push event notifications whenever changes are made to your repository. You can find the webhook details in Cloud Manager, and they are unique for each repository.

The webhook requires an API key, which is the same key used for interacting with any Cloud Manager API. For more details on generating the Cloud Manager public API key, refer to the public documentation. Additionally, a webhook secret must be configured in your git vendor solution when creating the webhook. This secret will be used to sign each event sent to Cloud Manager.

2. Configure your AEM Site to use Cloud Manager

Next, you need to add the code repository to your site configuration. If you are new to Edge Delivery Services, see here for an introduction to the configuration service and familiarize yourself with the API.

curl -X PUT https://admin.hlx.page/config/acme/sites/site.json \
  -H 'content-type: application/json' \
  -H 'x-auth-token: <your-auth-token>' \
  --data '{
  "version": 1,
  "code": {
    "source": {
      "url": "https://cm-repo.adobe.io/api",
      "raw_url": "https://cm-repo.adobe.io/api/raw",
      "owner": "{programId}",
      "repo": "{repositoryId}",
      "type": "byogit"
    }
  },
  "content": {
    "source": {
      "url": "https://acme.sharepoint.com/sites/aem/Shared%20Documents/site"
    }
  }
}'

You will need to replace {programId} and {repositoryId} with the actual data from Cloud Manager. These details can be easily found in the “Configure Webhook” section of the repository.

3. Contact Adobe to complete the onboarding process

As this is an early access feature, an Adobe representative will need to perform some additional steps to complete the onboarding process. Send an email to Grp-CloudManager_BYOG@adobe.com from your email address associated with your Adobe ID. Be sure to include which Git platform you want to use and whether you are on a private/public or enterprise repository structure.

4. Verify your AEM Site

Browse your site at https://main--site--acme.aem.page
to ensure the initial synchronization from your external repository has worked as expected.

To test continuous code synchronization, make a change to one of your code files (ideally something easy to spot in the browser) and push it to the main branch of your external repository and ensure the change is reflected on your AEM Site.

Note: Code synchronization happens asynchronously and your changes may not be reflected immediately. Disable your browser cache or use an incognito window for testing to circumvent your browser’s cache and force it to fetch all resources from the server.