Cicd
Code Pipeline
- Pipeline controls the code - build - deploy flow
- Pipelines are built from stages
- State changes trigger events that are available for consumers through EventBridge
Code Build
- Build as a service. Uses Docker for build environments
- buildspec.yml is used to customize build
- There are 4 phases of build
- Install - Install basic packages necessary for build
- pre_build - sign in or install dependencies
- build - compilation etc
- post_build - packaging, push build artifacts etc
Code Deploy
- Deploys code & not resources or provision environments
- Code Deploy agent needs to be installed on on premise servers or EC2
- Appspec.yml is used for customizations
- Files section defines which files need to deployed in case of EC2 or on Premise deployments
- Resources section provides details of lambda or of ecs images to be deployed
- Permissions section defines any specific permissions that need to be defined for things mentioned in Files section
- One can define scripts that run on lifecycle hooks of your deployment environment
- The hooks can be for ApplicationStop, DownladBundle, BeforeInstall, Install, AfterInstall,ApplicationStart, ValidateService