Reputation: 18157
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?
Upvotes: 11
Views: 10330
Reputation: 1301
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.Upvotes: 7
Reputation: 9916
CodeBuild now provides a cache feature you can use to pre-load your dependencies.
Upvotes: 15