Between 1 and 2 minutes of my AWS CodeBuilds are spent downloading dependencies from Maven Central.
Short of building a pre-provisioned Docker container, is there any way to cache these between builds?
Content Delivery Network (CDN) A CDN provides you the ability to utilize its global network of edge locations to deliver a cached copy of web content such as videos, webpages, images and so on to your customers.
Build artifact encryption - The CodeBuild service role associated with the build project requires access to a KMS key in order to encrypt its build output artifacts. By default, CodeBuild uses an AWS managed key for Amazon S3 in your AWS account.
CodeBuild - A scalable service to compile, test, and package source code. CodeDeploy - A service to automate code deployments anywhere.
zip , the output artifact is stored in MyArtifacts/<build-ID>/MyArtifact. zip . If this flag is set, a name specified in the buildspec file overrides the artifact name. The name specified in a buildspec file is calculated at build time and uses the Shell Command Language.
CodeBuild now provides a cache feature you can use to pre-load your dependencies.
Unsigned's answer is good but is a tad outdated. As of February 2019, CodeBuild allows both caching in an S3 bucket and allows the user to cache locally. You can now specify cache at 3 different layers of a build:
git diff
)cache:
portion of your buildspec.yml file. Personally, I cache my node_modules/ here and then cache at the Git Layer.Source: https://aws.amazon.com/blogs/devops/improve-build-performance-and-save-time-using-local-caching-in-aws-codebuild/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With