CodeBuild use case-based samples - Amazon CodeBuild
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China.

CodeBuild use case-based samples

You can use these use case-based samples to experiment with Amazon CodeBuild:

Amazon ECR sample

Uses a Docker image in an Amazon ECR repository to use Apache Maven to produce a single JAR file.

Amazon EFS sample

Shows how to configure a buildspec file so that a CodeBuild project mounts and builds on an Amazon EFS file system.

Amazon CodeDeploy sample

Uses Apache Maven to produce a single JAR file. Uses CodeDeploy to deploy the JAR file to an Amazon Linux instance. You can also use CodePipeline to build and deploy the sample.

Amazon CodePipeline integration with batch builds sample Amazon CodePipeline integration with multiple input sources and output artifacts sample

Shows how to use Amazon CodePipeline to create a build with multiple input sources and multiple output artifacts.

Amazon Config sample

Shows how to set up Amazon Config. Lists which CodeBuild resources are tracked and describes how to look up CodeBuild projects in Amazon Config.

Amazon Elastic Beanstalk sample

Uses Apache Maven to produce a single WAR file. Uses Elastic Beanstalk to deploy the WAR file to an Elastic Beanstalk instance.

Bitbucket pull request and webhook filter sample

Uses CodeBuild with Bitbucket as the source repository and webhooks enabled, to rebuild the source code every time a code change is pushed to the repository.

Build badges sample

Shows how to set up CodeBuild with build badges.

Build notifications sample

Uses Apache Maven to produce a single JAR file. Sends a build notification to subscribers of an Amazon SNS topic.

Create a test report using the Amazon CLI sample

Uses the Amazon CLI to create, run, and view the results of a test report.

Docker in custom image sample

Uses a custom Docker image to produce a Docker image.

Docker sample

Uses a build image provided by CodeBuild with Docker support to produce a Docker image with Apache Maven. Pushes the Docker image to a repository in Amazon ECR. You can also adapt this sample to push the Docker image to Docker Hub.

GitHub Enterprise Server sample

Uses CodeBuild with GitHub Enterprise Server as the source repository, with certificates installed and webhooks enabled, to rebuild the source code every time a code change is pushed to the repository.

GitHub pull request and webhook filter sample

Uses CodeBuild with GitHub as the source repository and webhooks enabled, to rebuild the source code every time a code change is pushed to the repository.

Host build output in an S3 bucket

Shows how to create a static website in an S3 bucket using unencrypted build artifacts.

Multiple input sources and output artifacts sample

Shows how to use multiple input sources and multiple output artifacts in a build project.

Private registry with Amazon Secrets Manager sample

Shows how to use a Docker image in a private registry as the runtime environment when building with CodeBuild The private registry credentials are stored in Amazon Secrets Manager.

Runtime versions in buildspec file sample

Shows how to specify runtimes and their versions in the buildspec file. This is a requirement when using the Ubuntu standard image version 2.0.

Source version sample

Shows how to use a specific version of your source in a CodeBuild build project.

Use semantic versioning to name build artifacts sample

Shows how to use semantic versioning to create an artifact name at build time.