I\'ve been trying to get AWS CodeBuild\'s local cache to work and for the life of me I can\'t get even the most basic cache to work. My ultimate goal is to cache Gradle arti
The documentation isn't exactly clear, but AWS CodeBuild Local cache can only cache directories (as of time of writing). This is slightly confusing because the AWS CodeBuild buildspec specification allows the path to be individual files or a wildcard, but in reality specifying a file will yield an error.
Unable to initialize cache download: only directories can be cached locally: ...
In your example you use specify the cache as
cache:
paths:
- '/root/foo/*'
Where * would refer to all individual files and folders inside foo but only folders would be cached.
Specifying the entire directory should work
cache:
paths:
- /root/foo/