Developer Theory Summary
CI/CD Exam Tips
- Definitely worth a few points in the exam
- Worth reading the white paper: https://d1.awsstatic.com/whitepapers/DevOps/practicing-continuous-integration-continuous-delivery-on-AWS.pdf
- Continuous Integration
- integrating or merging the code changes frequently
- atleast once per day
- enables multiple devs to work on the same application
- integrating or merging the code changes frequently
- Continuous Delivery
- automating the build, test, and deployment functions
- Continuous Deployment
- fully automates the entire release process
- code is deplyoed into Production as soon as it has successfully passed through the release pipeline
-
- AWS CodeCommit
- source control service (git)
- AWS CodeBuild
- compile source code
- run tests
- package code
- AWS CodeDeploy
- Automated Deployment to EC2, on premises systems, and Lambda
- AWS CodePipeline
- CI/CD workflow tool
- Fully automates the entire release process (build, test, deployment)
-
- AWS CodeCommit
- Based on Git
- Centralized repository for all your code, binaries, images, and libraries
- Tracks and manages code changes
- Maintains version history
- Manages updates from multiple sources and enables collaboration
- AWS CodeDeploy
- Fully managed automated deployment service and can be used as part of a Continuous Delivery or Continuous Deployment process
- Different types of deployment approaches:
- In-Place or Rolling update
- Stop the application on each host and deploy the latest code
- EC2 and on premise systems only
- To roll back you must re-deploy the previous version of the application
- Blue/Green
- New instances are provisioned and the new application is deployed to these instances
- Traffic is routed to the new instances according to your own schedule
- supported for EC2, on-premise systems, and Lambda
- Roll back is easy
- Route the traffic back to the original instances
- Blue is the active deployment, green is the new release
- In-Place or Rolling update
CodeDeploy Advanced Settings - Exam Tips
- The AppSpec file defines all the parameters needed for the deployment
- e.g. location of the application files and pre/post deployment validation tests to run
- For EC2 / On Premises systems, the appspec.yml file must be placed in the root directory of your revision (the same folder that contains your application code)
- WRitten in YAML
- Lambda supports YAML or JSON
- The Run Order of Hooks in a CodeDeploy deployment:
- BeforeBlock Traffic -> BlockTraffic -> AfterBlockTraffic
- Application Stop
- BeforeInstall
- Install
- AfterInstall
- ApplicationStart
- ValidateService
- BeforeAllowTraffic -> AllowTraffic -> AfterAllowTraffic
AWS CodePipeline Exam Tips
- Continuous Integration / Continuous Delivery Service
- Automates your end-to-end software release process based on a user defined workflow
- Can be configured to automatically trigger your pipeline as soon as a change is detected in your source code repository
- update code in S3
- triggers pipeline to deploy to instances
- Integrates with other services from AWS like CodeBuild and CodeDeploy, as well as third party and custom plug-ins
CodeBuild Exam Tips
- CodeBuild is a fully managed build service
- It can build source code, run tests, and produce software packages based on commands that you define yourself
- By default, the buildspec.yml defines the build commands and settings used by CodeBuild to run your build
- You can completely override the settings in buildspec.yml by adding your own commands in the console when you launch the build
- If your build fails, check the build logs in the CodeBuild console
- can view the full CodeBuild log in CloudWatch