Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Re-use CodeBuild instance in CodePipeline

I'm working with AWS CodePipelines and CodeBuild (through the CodeBuildAction construct). Within my pipeline, I have multiple stages each with N number of actions. I end up having multiple CodeBuild instances across all my stages. This ends up making the pipeline take much longer than I think it should (provisioning each CodeBuild instance takes around 1 minute). I would like to know if there is a work around or feature to allow for using the same CodeBuild instance across all actions that need it but provide different commands which will be run in the environment for each action.

I've seen these two articles from AWS' CodeBuild docs, but they don't seem to be quite what I'm looking for.

Project Sharing

Build Caching

Based on the article on build caching, I'm a bit unclear on what exactly is being cached and how this improved performance.

  1. What about the environment is being cached and how does caching it improve performance? (I know the docs say "build artifacts" but does that mean only the things I'm building within a code build, the configuration of the environment, the instance as a whole?)
  2. When using CloudBuild, the PROVISIONING stage takes around 55 seconds consistently. Does the build caching feature address that? If so, how?
like image 905
Garrett Avatar asked Dec 05 '25 15:12

Garrett


1 Answers

I think you might be interested into the caching option: Here is a blog post about it: https://aws.amazon.com/blogs/devops/improve-build-performance-and-save-time-using-local-caching-in-aws-codebuild/

and the official documentation: https://docs.aws.amazon.com/codebuild/latest/userguide/build-caching.html

like image 114
brushtakopo Avatar answered Dec 09 '25 14:12

brushtakopo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!