Table of contents
What if I tell you, in next 4 days, you'll be making a CI/CD pipeline on AWS with these tools.
CodeCommit
CodeBuild
CodeDeploy
CodePipeline
S3
What is Code Commit ?
- Code Commit is a managed source control service by AWS that allows users to store, manage, and version their source code and artefacts 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, Code Commit 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.
- 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.
- 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.
- 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.
- 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!