Github.com repositories

Learn how to connect a private GitHub repository to AEM Cloud Manager for streamlined code quality management and automated workflows. Enhance your development process with integrated checks and seamless collaboration.

Transcript
In this video, we’ll explore how to connect a private GitHub repository to AEM Cloud Manager. This integration allows us to manage code quality directly within GitHub using pull requests, eliminating the need to constantly sync with Adobe Git repository. By doing so, we streamline our workflow and enhance our code quality management process. Currently, I have an Adobe Git repository that’s used to hold my AEM project codebase. But let’s explore how we can hook up this private GitHub repository containing this code to AEM Cloud Manager. First, in order to set up our GitHub repository in Cloud Manager, we’ll navigate to our repositories and click add repository. Here, select the private repository type since this is a private non-Adobe managed Git repository. And let’s give our repository a clear and descriptive name. I’ll call mine weekend github.com. Then provide the repository’s URL, which you could find under code on the GitHub repository page. Make sure to use the HTTPS URL and not the SSH URL. Let’s also give it a description in Cloud Manager so our teammates can easily understand what this represents later on. With the private repository details configured, we save the changes. Since we selected private repository, we now need to validate our ownership of that repository. This involves installing the Cloud Manager for AEM GitHub app on our GitHub repository. We can click on the provided link in the modal to open up a new tab and follow the steps to install the app. You only need to allow this GitHub app to access the repository you want to connect to Cloud Manager. Next, we need to create a well-known file that contains a secret to prove our ownership of the GitHub repository. This step is essential as it ensures that only authorized users can link the repository to Cloud Manager. We can create this file in our GitHub repository’s default branch, in this case main, at the path specified in the modal. Copy and paste the secret provided by Cloud Manager into this file and commit the changes to the main branch. Once the repository has been validated, it will appear in Cloud Manager with a repository type of GitHub. Now, let’s set up a non-production deployment pipeline that uses this GitHub repository. This pipeline will allow us to test our changes in a development environment before we promote them to stage and eventually production. Let’s name our pipeline and we’ll use the default deployment options. Then, select the deployment type, in this case it’s a full stack project, so we’ll select that, and then select the AM as a cloud service environment to deploy to, in this case the development environment. Next, we have to choose the repository that will provide the code for this pipeline. In this case, we’ll want to select our newly created GitHub repository. Since a dedicated development branch helps maintain a clean and organized workflow, separating stable code from experimental changes, let’s quickly create a develop branch on GitHub that will hook up to this non-production pipeline. For that, we can jump back to GitHub and create a new branch name developed from main. Back in Cloud Manager, refresh the branches, and we can now select our new develop branch. Before we run this new pipeline that deploys the GitHub develop branch code to AME as a cloud services development environment, let’s take a look at how using a GitHub repository with Cloud Manager can help us manage code quality and accelerate the development process. For this, we’ll head back to GitHub, and let’s say we need to make a small change to the byline components HTML file. Specifically, we need to change the delimiter for the occupations from a comma to a pipe. So let’s quickly do this. Let’s quickly do this. We can create a new branch for this change and submit a pull request from this new branch to our develop branch. The pull request process is crucial for collaborative development, allowing team members to review and discuss changes before merging them into branches that deploy to our AME as a cloud service environments. The pull request works like any other pull request on GitHub. You can see the files change, design viewers, leave comments, etc. But this integration also adds a really great added bonus. It exposes Cloud Manager code quality checks directly in the pull request. If we scroll down, we can see we have some of these standard Maven build checks that are part of the project itself. But the last check here is a new Adobe specific check, the Cloud Manager code quality pipeline check. This check will spawn a new code quality pipeline in Cloud Manager for the pull request and run all its checks. These do take a few minutes to run, so let’s skip forward in time to when they’re done. All right, it looks like they all finished. The Cloud Manager code quality pipeline check outputs the code quality status right here in GitHub as part of the pull request. We can see that we’ve passed with the exception of eight non-critical issues. If we want more information on this, we can simply click on the pipeline execution page link at the bottom, and it’ll take us directly to the Cloud Manager pipeline execution page, where we can see all the details of the checks that were run from the summary to the details, as well as the build logs. Having Cloud Manager’s checks, other custom checks you might have configured in GitHub, and human review in the pull request process all in one place means we can review and catch any issues before merging code into our primary branches. This unified approach simplifies code reviews, ensuring that all feedback and quality checks are visible and actionable within GitHub. It reduces the risk of integrating faulty code and helps maintain high standards across the development lifecycle. Okay, let’s say we reviewed the pull request and we’re okay with these eight non-critical issues. In GitHub, we can merge the pull request into our development branch, and upon deleting this source branch of the pull request, the Cloud Manager quality pipeline will be deleted automatically, ensuring Cloud Manager doesn’t become overrun with hundreds of code quality pipelines. Finally, to deploy the changes from our GitHub develop branch to our aim as a cloud service development environment, simply run the new pipeline in Cloud Manager. Now, we can run the new pipeline in the Cloud Manager pipeline. This process works just the same as any Adobe Git repository. The latest commit from the pipelines branch is checked out, built, and deployed. You can, of course, set up similar production pipelines from the main branch to deploy to stage and production. So, as you’ve seen, integrating GitHub with AEM Cloud Manager not only simplifies our development workflow, but also enhances your ability to maintain high code quality. By leveraging GitHub’s collaborative features and Adobe’s quality checks, you create a more efficient, reliable, and secure development process.
recommendation-more-help
4859a77c-7971-4ac9-8f5c-4260823c6f69