AWS Automation Cookbook
上QQ阅读APP看书,第一时间看更新

Introducing AWS CodeBuild

When it comes to cloud-hosted and fully managed build services, which compiles our source code, runs unit tests, and produces artifacts that are ready to deploy, then AWS CodeBuild comes into the picture.

Instead of using Jenkins or Bamboo, we can use AWS CodeBuild, and then skip the following issues:

  • Setting up a Jenkins on a server and maintaining it
  • Maintaining the cluster security
  • Upgrading the Jenkins software over time
  • Monitoring and recovering from Jenkins downtime
  • Capacity planning so the cluster can handle all our build volume

If you setup the build server of your own, then you have to pay a big bill to the engineers to keep the cluster scaled up 24/7 and maintain the Jenkins cluster. If the build server will have any issues, then the team won't be able to ship the latest code, until the build server is fixed.

AWS CodeBuild is elastic, scalable, and easy to use. It has a couple of inbuilt build environments for popular programming languages and build tools such as Gradle, Maven, and more. You can modify the build environments in AWS CodeBuild accordingly, to use your own build tools.

With AWS CodeBuild operations are negligible and costs are reduced to on-demand usage. So, your team is now only focused on pushing code, and lets CodeBuild build all the artifacts.

Let’s take a look at the necessary components of AWS CodeBuild:

  • Source repository: This is the location of your source code
  • Build spec: This builds commands
  • Build environment: This is your runtime environment
  • Compute type: This is the amount of memory and compute power required
  • IAM role: This grants CodeBuild the permission to access specific AWS services and resources