Day 50: Your CI/CD pipeline on AWS -Part-1
In the rapidly evolving landscape of software development, where efficiency, speed, and reliability are paramount, Continuous Integration and Continuous Deployment (CI/CD) pipelines have emerged as indispensable tools. These pipelines not only streamline the development process but also ensure that software updates reach users seamlessly, without disruption. In this two-part series, we embark on a journey to demystify the process of setting up a robust CI/CD pipeline on Amazon Web Services (AWS).
In coming sessions, We’ll be making a CI/CD pipeline on AWS with these tools.
-CodeCommit
- CodeBuild
- CodeDeploy
- CodePipeline
- S3
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.
Some of the features of CodeCommit are :
- Repository Hosting: CodeCommit provides a secure and scalable environment to host your Git repositories. It supports both public and private repositories, allowing you to control access to your source code.
- Branching and Merging: You can create branches within your repository to work on different features or fixes independently. Once the work is completed, branches can be merged back into the main codebase.
- Code Review: CodeCommit includes built-in code review capabilities, enabling developers to collaborate effectively on code changes. You can create pull requests to propose code modifications, and team members can review and comment on the changes before they are merged.
- Access Control: AWS Identity and Access Management (IAM) integration enables fine-grained access control to your repositories. You can define who has read and write access to specific repositories or branches.
- Integration with CI/CD: CodeCommit seamlessly integrates with other AWS services like AWS CodeBuild, AWS CodeDeploy, and AWS CodePipeline, making it an integral part of the CI/CD pipeline. This integration allows for automated testing, building, and deploying code changes.
- Security and Compliance: CodeCommit ensures data security through encryption at rest and in transit. It is compliant with various industry standards and regulations, making it suitable for organizations with strict security and compliance requirements.
- Scalability: Being a managed service, CodeCommit automatically scales to accommodate your growing codebase and user activity without requiring manual intervention.
- Notifications: You can set up notifications to receive alerts about code changes, pull requests, and other events in your repositories, helping you stay informed about the development process.
Tasks -
Task 1) Set up a code repository on CodeCommit and clone it on your local. You need to setup GitCredentials in your AWS IAM.
Use those credentials in your local and then clone the repository from CodeCommit
Open aws console and search for CodeCommit
Click on Create repository
Your repository will be created here
Now go to IAM and select the current user
Click on Generate credentials
Now copy the clone command of your repo and paste it in your file system
Here, we have successfully cloned our repository.
Task 2 ) Add a new file from local and commit to your local branch
Open the local system, Create a new file called tasks.txt
Execute the below commands
git add .
git commit -m "message"
Push the local changes to CodeCommit repository.
Using the following command, push the changes from your local to the CodeCommit repository.
git push origin master
Verify that the files are pushed into the CodeCommit repository.
In the CodeCommit Repository > Repositories > Code.
And yay! You have pushed your local files to the CodeCommit Repository.