Day 50: Your CI/CD pipeline on AWS - Part-1 ๐Ÿš€

Day 50: Your CI/CD pipeline on AWS - Part-1 ๐Ÿš€

ยท

3 min read

This is#90DaysofDevopschallenge under the guidance of Shubham Londhe sir.

Introduction

Are you ready to embark on a journey to build your own CI/CD pipeline on AWS? Over the next four days, we'll be diving deep into setting up a robust pipeline using the following tools:

  1. CodeCommit

  2. CodeBuild

  3. CodeDeploy

  4. CodePipeline

  5. S3

What is CodeCommit?

  • AWS CodeCommit is a managed source control service offered by Amazon Web Services (AWS). It provides a secure and scalable platform for hosting private Git repositories. With AWS CodeCommit, developers can store and manage their code securely in the cloud, collaborate with team members, and track changes to their codebase over time.

  • The service integrates seamlessly with other AWS tools and services, enabling developers to build and deploy applications more efficiently. Overall, AWS CodeCommit simplifies the process of version control and helps teams deliver high-quality software faster.

Task-01: Setting Up Code Repository on CodeCommit and Cloning it Locally

  1. Set up a code repository on CodeCommit:

    • Log in to your AWS Management Console.

    • Navigate to the CodeCommit service.

    • Click on "Create repository" and provide a name for your repository.

    • Choose your repository settings and create the repository.

  2. Setting up GitCredentials in your AWS IAM:

    • Go to the IAM service in the AWS Management Console.

    • Create a new IAM user or use an existing one.

    • Attach the required IAM policies for accessing CodeCommit repositories.

    • Under the "Security credentials" tab, find the "HTTPS Git credentials for AWS CodeCommit" section.

    • Click on the "Generate" button to create Git credentials for the IAM user.

    • Note down the generated HTTPS Git credentials including the username and password.

  3. Using GitCredentials in your local environment:

    • Install Git on your local machine if you haven't already.

    • Configure Git to use the IAM user's credentials by running the following commands in your terminal:

        git config --global credential.helper '!aws codecommit credential-helper $@'
        git config --global credential.UseHttpPath true
      

  4. Cloning the repository from CodeCommit:

    • Copy the HTTPS or SSH clone URL of your CodeCommit repository.

    • Open your terminal and navigate to the directory where you want to clone the repository.

    • Run the following command:

        git clone <repository-URL>
      
    • Replace <repository-URL> with the URL you copied from CodeCommit.

    • When cloning a repository, a popup prompts you to add credential.

Task-02: Adding a New File Locally, Committing, and Pushing Changes to CodeCommit Repository

  1. Adding a new file from your local environment:

    • Create a new file or make changes to an existing file in your local repository directory.

  2. Committing the changes to your local branch:

    • Open your terminal and navigate to the repository directory.

    • Use the following commands to stage and commit your changes:

        git add .
        git commit -m "Your commit message"
      

    • Replace "Your commit message" with a descriptive message explaining your changes.

  3. Pushing the local changes to the CodeCommit repository:

    • Run the following command:

        git push origin <branch-name>
      

    • Replace <branch-name> with the name of the branch you want to push your changes to.

By following these steps, you'll successfully set up a CodeCommit repository, clone it locally, add new files, commit changes, and push them back to the repository on AWS CodeCommit.

๐Ÿ’ก
If you have any questions or need help, feel free to ask in the comments section! ๐Ÿค” I would be happy to answer them!
๐Ÿ’ก
If you found the content helpful, please consider giving it a thumbs up ๐Ÿ‘ and following for more useful information. Your support is greatly appreciated!

Thanks for taking the time to read! ๐Ÿ’œ

Did you find this article valuable?

Support Akash Dhengale by becoming a sponsor. Any amount is appreciated!

ย