Day 50: Your CI/CD pipeline on AWS - Part-1 ๐Ÿš€ โ˜ (Jan 15, 2024)

Day 50: Your CI/CD pipeline on AWS - Part-1 ๐Ÿš€ โ˜ (Jan 15, 2024)

ยท

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 just like GitHub. 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.
  1. Login to aws account by using valid credentials. Search โ€œCodeCommitโ€ from search box and click on it. Click on โ€œCreate repositoryโ€.

2. Enter mandatory details like โ€œRepository nameโ€. Click on โ€œCreateโ€.

3. Repository will be created and visible.

  • You need to setup GitCredentials in your AWS IAM.
  1. Open visual studio code and open a new terminal. Give command โ€œgit statusโ€. Error will come.

2. Go to search box in aws console. Search for โ€œIAMโ€. Click on โ€œUsersโ€.

3. Your user will be visible. Click on the user.

4. After clicking on user, navigate to โ€œSecurity credentialsโ€.

5. Under security credentials, scroll down and come to โ€œHTTPS Git credentials for AWS CodeCommitโ€. Click on โ€œGenerate credentialsโ€.

6. Download your credentials in your system for further usage.

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

1. Click on third icon from left in VS Code. On top 3 dots will appear. Click on three dots. โ€œRemoteโ€ option will come. Under that โ€œAdd Remoteโ€ will be visible and click on it.

2. Enter cloned repository URL.

3. Enter username from the file which you downloaded earlier.

4. Enter password from the file which you downloaded earlier. Click on โ€œEnterโ€ button from your keyboard.

5. Click on โ€œAdd permissionsโ€ dropdown and click on โ€œAdd permissionsโ€.

6. Click on โ€œNextโ€.

7. Click on โ€œAdd permissionsโ€.

8. Your policy will be created and added to your user.

Task-02 :

  • Add a new file from local and commit to your local branch.
  1. Go to your VS Code. Clone your repository from CodeCommit using command โ€œgit clone <repository_url>โ€. Make a new file โ€œindex.htmlโ€ and write desired code in it as given below in the screenshot.

2. Fire the command โ€œgit statusโ€, โ€œgit add .โ€, โ€œgit comit -m โ€œ<any_message>โ€โ€.

  • Push the local changes to CodeCommit repository.
  1. Fire the command โ€œgit push origin masterโ€ to push newly made file in local to CodeCommit repository.

2. Open CodeCommit. Go to your repository and click on it.

3. You will be able to see โ€œindex.htmlโ€ file in your repositoory.

Thanks for reading the blog. Hope it helps!

ย