CI/CD Pipeline On AWS (Part -1) CodeCommit

CI/CD Pipeline On AWS (Part -1) CodeCommit

Day 50 of 90daysofdevops

ยท

3 min read

What is CodeCommit?

  • CodeCommit is a managed source control service by AWS that allows users to store, manage, and version their source code and artifacts securely and at scale. It supports Git, integrates with other AWS services, enables collaboration through branch and merge workflows, and provides audit logs and compliance reports to meet regulatory requirements and track changes. Overall, CodeCommit provides developers with a reliable and efficient way to manage their codebase and set up a CI/CD pipeline for their software development projects.

Task-01 :

  • Set up a code repository on CodeCommit and clone it on your local.

  • You need to set up GitCredentials in your AWS IAM.

  • Use those credentials in your local and then clone the repository from CodeCommit


Set up a code repository on CodeCommit and clone it on your local.

  • Log in to the AWS Management Console and navigate to CodeCommit.

    Now click on Create Repository.

  • Enter a name for your repository and click on 'Create'

  • The repository is successfully created.

Set up GitCredentials in your AWS IAM

  • Go to the IAM console. Click on Users in the left-hand menu, and then click on the defined username.

  • Scroll down to the Security credentials section.

  • In the "HTTPS Git credentials for AWS CodeCommit" section, click on "Generate Credentials"

  • Click on the Download credentials button to download your Git credentials in your local system and click on 'close'.

  • Git credentials are created successfully.

Use those credentials in your local and then clone the repository from CodeCommit

  • In Code Commit, Go inside the repository that you created in the above steps, in the right-hand side click on 'Clone URL' and copy the HTTPS of Repository.

  • Open a terminal on your local machine.

    Navigate to the directory where you want to clone the repository.

    Run the following command:

      git clone <your-codecommit-repo-clone-https-url>
    

  • You will be prompted to enter your Git credentials. Enter the username and password that you downloaded earlier.

  • Once you click on Continue, it will authenticate using Git Credentials in AWS IAM. As verification is successful have the CodeCommit repository cloned it on your local machine.


Task-02 :

  • Add a new file from local and commit to your local branch

  • Push the local changes to the CodeCommit repository.

Add a new file from local and commit to your local branch

  • Create a new file in the local repository directory.

  • Check the status using the command git status

  • Add the new file to your local branch using the following command:

      git add <filename>
    
      # Check the status of your file 
      git status
    

  • Commit the changes to your local branch using the following command:

      git commit -m "added new test file"
    

Push the local changes to the CodeCommit repository.

  • Push the changes from your local branch to the CodeCommit repository using the following command:

      git push origin master
    

  • Verify that the changes have been pushed to the CodeCommit repository.

    Go to the code commit repository that you created earlier, you should see the new file listed in the repository's files.

  • You can see the content of the file.


Thank You,

I want to express my deepest gratitude to each and every one of you who has taken the time to read, engage, and support my journey.

Feel free to reach out to me if any corrections or add-ons are required on blogs. Your feedback is always welcome & appreciated.

~ Abhisek Moharana ๐Ÿ™‚

ย