CodeBuild
💡 Definition
AWS CodeBuild is a fully managed continuous integration service that compiles source code, runs tests, and produces software packages that are ready to deploy.
🔑 Key Concepts
- Build Service: Compiles code and runs unit tests.
- Serverless: No build servers to manage. Scales automatically to meet peak build requests.
- Artifacts: Produces build artifacts (e.g., WAR files, ZIP files, Docker images) stored in S3.
- Buildspec: Uses a
buildspec.ymlfile to define build commands and settings.
⚙️ How it Works
- Source: Connects to CodeCommit, S3, or GitHub.
- Build: Provision a temporary container, run the commands in
buildspec.yml. - Output: Upload the resulting artifacts to an S3 bucket.
🎯 Use Cases
- Continuous Integration (CI): Running tests automatically whenever code is pushed.
- Compiling Code: Turning source code into executable applications.
- Docker Images: Building and pushing Docker images to Amazon ECR.
💰 Pricing Model
- Build Minutes: Charged per minute based on the compute instance type used for the build.
📝 Exam Tips (CLF-C02)
- "Compiles source code, runs tests, produces software packages".
- Serverless build service.
- Uses
buildspec.yml.
See Also: * CodeCommit * CodePipeline * CodeDeploy