Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security & DevOps Insights

  • Home
  • About
  • Advertise With US
  • Reviews
  • Contact
  • Toggle search form
Home » AWS/Azure/OpenShift » How to integrate AWS CodeBuild and AWS CodeCommit to SonarCloud
  • Join Synology NAS to Active Directory Domain and Create New Users
    Create New Users and Join Synology NAS to Active Directory Reviews
  • BitLocker Recovery Password Rotation in Active Directory
    Perform BitLocker Recovery Password Rotation in Active Directory Windows Server
  • Prevent Standard Users from Changing BitLocker Password
    How to Prevent Standard Users from Changing BitLocker Password Windows
  • dtjdhn
    The action cannot be completed because the folder or file is open in another program: Determine where a file is open in Windows Windows
  • proxmox
    Clone a Proxmox Container: CT Restoration Guide Virtualization
  • Featured image 4
    How to remove a Device from your Microsoft Account Microsoft Exchange/Office/365
  • Watchguard Firewall 180504 100511 1
    WatchGuard Firebox: Restoring Backups on XTM Device Network | Monitoring
  • Screenshot 2021 04 03 at 18.30.29
    Setup Windows server backup and create backup jobs with Bare metal backup Backup

How to integrate AWS CodeBuild and AWS CodeCommit to SonarCloud

Posted on 19/03/202223/08/2023 Temitope Odemo By Temitope Odemo No Comments on How to integrate AWS CodeBuild and AWS CodeCommit to SonarCloud
AWS CodeBuild

It is always a challenge to have your code released without bugs or vulnerabilities. There is a need to have a quality code and a very efficient code review process. We have several tools in the marketplace that can be integrated into your DevOps to provide you insights into your code and one of the best tools out there is SonarCloud. This tool conduct code analysis and defined the process to enforce code control on three levels which are syntax, code standards, and structure. SonarCloud will always ensure that all issues are flagged before code is sent for testing and can be quickly fixed by the developer so that high-quality code is released to the production all the time.

If you want to read more on AWS you can check these guides: How to manage and use Amazon S3 access points using the AWS Management Console, how to enable Amazon S3 default bucket encryption using S3 Console, how to deploy a .NET application to AWS Elastic Beanstalk using AWS Tool Kit, How to Deploy MVC Application to AWS EC2 Using RDP Connection and Web Deploy.

AWS CodeCommit is a secure, highly scalable, managed source control service provided by amazon web services that you can use to host your Git-based code repositories. This service makes it very easy for teams to securely collaborate on code whereby the code is properly encrypted in transit and at rest. AWS CodeBuild is another fully managed service by AWS that can be used for a continuous integration service that compiles source code, run tests, and produces software packages or software installation files that are ready for deployment.

In this guide, I will be showing you how to integrate AWS CodeBuild and AWS CodeCommit to SonarCloud. Before we start, make sure you have a SonarCloud account and AWS account, as we will be pushing some codes to the AWS CodeCommit repository.

Initiating Project Analysis on SonarCloud

Go ahead and login to your SonarCloud Account. Then click on the plus icon on the right side and click Analyze new Project. In the next page, click on Create a Project Manually and enter a project key and display the name you like and click the Setup button.

AWS CodeCommit
Setting up your project Manually

We will not be using the recommended GitHub Actions rather we will be setting up manually.

SonarCloud integration
Choose Analysis Method

Then again Sonarcloud will request for your build and Operating system. Please select Other for the build while Linux as the OS because CodeBuild projects run on Linux.

You will now need to copy the SONAR_TOKEN details and the command and saved in a place that it can easily be access.

SonarCloud integration
Setting up your Build

Creating an AWS CodeCommit Repository: Step-by-Step Guide

Login to your AWS account and create a CodeCommit Project. Navigate to CodeCommit and click Create Repository and give the repository a name and click Create.

DevOps pipeline
Creating Repository

After creating the repository, clone the repository. After that, you can add your code into the repository. You can check this guide on how to add your code into the repository

Here, we need to add a special file to initiate the build process in CodeBuild. It is known as the buildspec.yml file. Create a file called buildspec.yml and paste the below content in it. You can copy the content from here

image-57
Creating file into your CodeCommit repo

You can change the buildspec.yml file values with the values you got when creating the sonar cloud project. Check below:

  • SONARCLOUD_ORG = Your Sonar Cloud Organization name
  • PROJECT_KEY = Your Sonar Project Key
  • SONARCLOUD_TOKEN = Your Sonar Project Token

After that you can then push the entire codebase to the repository.

The next step is Creating CodeBuild Project. Now let us navigate to CodeBuild and create a project. Give the build project a name and supply other details.

image-58
Create Build Project

Supply other source code details

image-59
Adding Source for your Build Project

Optimal CodeBuild Environment Configuration

For the CodeBuild Environment, you can use AWS managed image with Ubuntu Operating System and Standard runtime with image “aws/codebuild/standard:4.0”

After setting up the build project, you can initiate the build process. If everything is properly configured and progresses as planned, the Sonar scanner will effectively analyze the project. Learn how to integrate AWS CodeBuild to streamline this process and ensure successful project analysis.

image-60
Project Created

Build started

image-61
Build Started

Once you’ve successfully completed the build without any errors, you’ll have the opportunity to view the analysis report on SonarCloud. Discover insights on how to integrate AWS CodeBuild for a streamlined development process.

image-62
Code Analysis

I hope you found this blog post on How to integrate AWS CodeBuild and AWS CodeCommit to SonarCloud interesting and helpful. In case you have any questions do not hesitate to ask in the comment section.

Rate this post

Thank you for reading this post. Kindly share it with others.

  • Click to share on X (Opens in new window) X
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on Pinterest (Opens in new window) Pinterest
  • Click to share on Tumblr (Opens in new window) Tumblr
  • Click to share on Telegram (Opens in new window) Telegram
  • Click to share on WhatsApp (Opens in new window) WhatsApp
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to share on Mastodon (Opens in new window) Mastodon
  • Click to share on Bluesky (Opens in new window) Bluesky
  • Click to share on Threads (Opens in new window) Threads
  • Click to share on Nextdoor (Opens in new window) Nextdoor
AWS/Azure/OpenShift, Version Control System Tags:AWS, AWS CLI, Version Control, Windows 10, Windows Server 2016

Post navigation

Previous Post: Setup HTTPS users using Git credentials and Pushing Code to AWS CodeCommit
Next Post: How to Install Apache HTTP Server on Ubuntu 20.04 LTS

Related Posts

  • cloudqueryfeature
    How to Manage Cloud Assets in AWS with CloudQuery AWS/Azure/OpenShift
  • Move Resources On Azure
    Move Azure Resources between Subscriptions AWS/Azure/OpenShift
  • veeam backup for aws Processing postgres rds failed
    Veeam backup for aws Processing postgres rds failed: No valid combination of the network settings was found for the worker configuration AWS/Azure/OpenShift
  • Angular 1
    How to deploy an Angular App to AWS S3 AWS/Azure/OpenShift
  • Veeam Backup for Microsoft Azure
    Set up Veeam Backup for Microsoft Azure AWS/Azure/OpenShift
  • Amazon EC2 and S3
    How to sync S3 Bucket with an EC2 instance AWS/Azure/OpenShift

More Related Articles

cloudqueryfeature How to Manage Cloud Assets in AWS with CloudQuery AWS/Azure/OpenShift
Move Resources On Azure Move Azure Resources between Subscriptions AWS/Azure/OpenShift
veeam backup for aws Processing postgres rds failed Veeam backup for aws Processing postgres rds failed: No valid combination of the network settings was found for the worker configuration AWS/Azure/OpenShift
Angular 1 How to deploy an Angular App to AWS S3 AWS/Azure/OpenShift
Veeam Backup for Microsoft Azure Set up Veeam Backup for Microsoft Azure AWS/Azure/OpenShift
Amazon EC2 and S3 How to sync S3 Bucket with an EC2 instance AWS/Azure/OpenShift

Leave a Reply Cancel reply

You must be logged in to post a comment.

Microsoft MVP

VEEAMLEGEND

vexpert-badge-stars-5

Virtual Background

GoogleNews

Categories

veeaam100

sysadmin top30a

  • Join Synology NAS to Active Directory Domain and Create New Users
    Create New Users and Join Synology NAS to Active Directory Reviews
  • BitLocker Recovery Password Rotation in Active Directory
    Perform BitLocker Recovery Password Rotation in Active Directory Windows Server
  • Prevent Standard Users from Changing BitLocker Password
    How to Prevent Standard Users from Changing BitLocker Password Windows
  • dtjdhn
    The action cannot be completed because the folder or file is open in another program: Determine where a file is open in Windows Windows
  • proxmox
    Clone a Proxmox Container: CT Restoration Guide Virtualization
  • Featured image 4
    How to remove a Device from your Microsoft Account Microsoft Exchange/Office/365
  • Watchguard Firewall 180504 100511 1
    WatchGuard Firebox: Restoring Backups on XTM Device Network | Monitoring
  • Screenshot 2021 04 03 at 18.30.29
    Setup Windows server backup and create backup jobs with Bare metal backup Backup

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,841 other subscribers
  • RSS - Posts
  • RSS - Comments
  • About
  • Authors
  • Write for us
  • Advertise with us
  • General Terms and Conditions
  • Privacy policy
  • Feedly
  • Telegram
  • Youtube
  • Facebook
  • Instagram
  • LinkedIn
  • Tumblr
  • Pinterest
  • Twitter
  • mastodon

Tags

AWS Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Deployment Services Windows Server 2016

Copyright © 2025 TechDirectArchive

 

Loading Comments...
 

You must be logged in to post a comment.