CI/CD
Code Pipeline
- Flow
- Code -> Build -> Test -> Deploy -> Provision
- Every stage, the codes are called
Artifact
and stored in the S3. The next stage take theartifact
from the previous stage and after processing, create a newartifact
to pass it to the next stage. - In codePipeline, a single stage can have multiple action groups
- In code pipeline, for manual approval (SNS + Email), the user need two permission
- GetPipeline
- PutApproveResult
- We can trigger code pipeline using,
- Events
- Using event-bridge from code-commit
- Using code-star github app
- Webhook
- Script to hit the webhook of the code pipeline when code is updated
- Polling [Not Recommanded]
- Codepipeline always check the repository in a time interval and check if code is updated
- Troubleshooting of code pipeline
- Check the console
- Check the IAM permission
- Audit the failed API call using CloudTrail
AWS Codepipeline
AWS Codecommit
- Like
Github
- Responsible for
Code
portion
- Like
AWS Codebuild
- Like
Jenkins
- Responsible for
Build
andTest
portion
- Like
AWS Code Deploy
- Responsible for
Deploy
portion - Ues
AWS Beanstalk
orAWS Cloudformation
to provision the code - Can be use for deploying code to
- EC2 Instance
- On premise sever
- Lambda Function
- Use for
- Rapid release of new feature
- Updating
Lambda Function
- Avoid downtime during Application deployment
- Type of code deploy
- Linear (This deployment send traffic incrementally)
- All at once (All traffic shifts to new deployment)
- Canary (Can be define, how many traffic will flow new and updated deployments)
- Responsible for
- While deploying a code base
Code commit
can be a source stageBeanstalk
can be a deploy stageBlue/Green
Deployment- Isolation between
blue
andgreen
- Roll incoming traffic during deployments
- Minimum downtime
Cloudformation
can be used in stages, to deploy a test environment and delete after testing