- Newest
- Most votes
- Most comments
I would think you should be able to check for the presence of the directory during your build, and only call yarn install
if the directory is not present. For example:
if [ ! -d "/codebuild/output/src11111111/src/github.com/OUR_ORG/OUR_PROJECT/node_modules/@OUR_PACKAGE/common" ]; then
yarn install
fi
This would only run yarn install
if the directory does not exist, avoiding this error when the package cache exists due to local caching.
That said, S3 caching does tend to be faster than installing packages, since the files can be pulled without leaving the AWS network, and there is also less processing involved with the cache than there is with any package manager, so this option is worth exploring if the above doesn't work for you.
As for speeding up the build times, there aren't many general suggestions I can make, although if a significant portion of your build is in the PROVISIONING
state, you may find better performance by ensuring you are on the latest release of the CodeBuild image, as the docker image for this is cached, whereas the older versions may not be.
Unfortunately, I wouldn't have any examples I can offer for large repos using CodeBuild, however you are certainly free to open a case if you'd like us to take a closer look at your environment!
Relevant content
- asked a year ago
- Accepted Answerasked a year ago
- asked 4 years ago
- asked 3 months ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated 2 years ago