AWS CodeBuild is a fully managed continuous integration service that compiles source code, runs tests, and produces software packages that are ready to deploy.
With CodeBuild, you don’t need to provision, manage, and scale your own build servers.
CodeBuild scales continuously and processes multiple builds concurrently, so your builds are not left waiting in a queue.
You can get started quickly by using prepackaged build environments, or you can create custom build environments that use your own build tools.
With CodeBuild, you are charged by the minute for the compute resources you use.
You can initiate builds in CodeBuild after connecting to AWS CodeCommit, GitHub, GitHub Enterprise, Bitbucket, or Amazon S3.
You can also connect CodeBuild and your source repository with AWS CodePipeline, which automatically initiates a build every time you commit a change.
You can integrate CodeBuild into your existing CI/CD workflow by using its source integrations, build commands, or Jenkins integration.
You can easily extend your continuous integration workflow into continuous delivery with CodePipeline by integrating third-party load or user interface testing tools (e.g., BlazeMeter and Ghost Inspector) that initiate after CodeBuild completes the build.
You can then deploy to your instances or on-premises servers using services integrated with CodePipeline, such as CodeDeploy and Elastic Beanstalk.
Languages that require compiled binaries:
.NET (C#, F#, Visual Basic)
Java and JVM (Java, Scala, JRuby)
Go
iOS (Swift, Objective-C)
Many languages don’t require building. These are considered interpreted languages:
PHP
Ruby
Python
Node.js
CodeBuild can package dependencies ready for deployment.
A build project defines how CodeBuild runs a build.
It includes information such as where to get the source code, the build environment to use, the build commands to run, and where to store the build output.
A build environment represents a combination of operating system, programming language runtime, and tools that CodeBuild uses to run a build.
The Jenkins plugin for CodeBuild enables you to integrate CodeBuild with your Jenkins build jobs.
Instead of sending your build jobs to Jenkins build nodes, you use the plugin to send your build jobs to CodeBuild. This eliminates the need for you to provision, configure, and manage Jenkins build nodes.
Download source code.
Run commands configured in the buildspec in temporary compute containers (created fresh on every build).
buildspec.yml
Sits in source repo
Defines the commands to run for each build phase
Reports errors as a build failure and to the logs in the CodeBuild console
As input, you must provide CodeBuild with a build project.
Example:
version: 0.2
env:
variables:aintext:
JAVA_HOME: "/usr/lib/jvm/java-8-openjdk-amd64"
phases:
install:
runtime-versions:
commands:
- apt-get update –y
- apt-get install -y maven
pre_build:
commands:
- echo Nothing to do in the pre_build phase...
build:
commands:
- echo Build started on `date`
- mvn install
post_build:
commands:
- echo Build completed on `date`
artifacts:
files:
- target/messageUtil-1.0.jar
discard-paths: yes
Stream the build output logs to the service console and Amazon CloudWatch Logs.
Upload the generated artifact to an Amazon S3 bucket.
Run the AWS CLI create-project or update-project command, setting the buildspec value to the path to the alternate build spec file relative to the value of the built-in environment variable CODEBUILD_SRC_DIR. You can also do the equivalent with the create project operation in the AWS SDKs.
Run the AWS CLI start-build command, setting the buildspecOverride value to the path to the alternate build spec file relative to the value of the built-in environment variable CODEBUILD_SRC_DIR. You can also do the equivalent with the start build operation in the AWS SDKs.
Content
Content