5.2-AWS CodeBuild - Digital Cloud Training
5.2-AWS CodeBuild - Digital Cloud Training
With CodeBuild, you don’t need to provision, manage, and scale your own
build servers.
CodeBuild is integrated with KMS for encryption of build artifacts, IAM for
build permissions, VPC for network security, and CloudTrail for logging API
calls.
You can use CloudWatch alarms to detect failed builds and trigger SNS
notifications.
Benefits of CodeBuild
Fully managed by AWS.
CodeBuild Concepts
Build project – defines how CodeBuild will run a build defines settings
including:
Location of the source code.
The build environment to use.
The build commands to run.
Where to store the output of the build.
Build environment – the operating system, language runtime, and tools that
CodeBuild uses for the build.
You can bring your own build environments to use with AWS CodeBuild, such
as for the Microsoft .NET Framework.
You can package the runtime and tools for your build into a Docker image and
upload it to a public Docker Hub repository or Amazon EC2 Container
Registry (Amazon ECR).
When you create a new build project, you can specify the location of your
Docker image, and CodeBuild will pull the image and use it as the build
project configuration.
The build specification is a YAML file that lets you choose the commands to
run at each phase of the build and other settings.
You can override the default buildspec file name and location.
CodeBuild helps you get started quickly with sample build specification files
for common scenarios, such as builds using Apache Maven, Gradle, or npm.
The code sample shows the contents of a buildspec.yml file that is being
used to build a Docker image and push it to Amazon Elastic Container
Registry (ECR):
version: 0.2
phases:
install:
runtime-versions:
docker: 18
pre_build:
commands:
build:
commands:
post_build:
commands:
- docker push
$AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$IMAGE_REPO_NAME:$IMAGE_TAG
Exam tip: You must have a buildspec.yml file at the root of your source code.
Plaintext variables.
Secure secrets using the SSM Parameter store.
Phases:
Connect Follow
About us Facebook
Contact us Youtube