Hi all,
my project uses Gradle Wrapper for building. I've configured default Gradle cache instruction :
pipelines:
default:
- step:
caches:
- gradle
According to docs, default Gradle cache targets '~/.gradle/wrapper' folder, but output of my build shows that downloaded Gradle dist gets unzipped to '/root/.gradle':
Unzipping /root/.gradle/wrapper/dists/gradle-4.7-all/4cret0dgl5o3b21weaoncl7ys/gradle-4.7-all.zip to /root/.gradle/wrapper/dists/gradle-4.7-all/4cret0dgl5o3b21weaoncl7ys
Set executable permissions for: /root/.gradle/wrapper/dists/gradle-4.7-all/4cret0dgl5o3b21weaoncl7ys/gradle-4.7/bin/gradle
So to me caching misses the right folder, and Gradle is download again and again with every run of the pipeline.
Maybe I should setup a custom cache targetting '/root/.gradle/wrapper'?
Any hint?
Thanks
Christian
Hello Christian,
The caching behaviour you see there is specifically for downing the Gradle binaries. What Docker image as your using for your build environment? Does it have Gradle installed? You can check by running 'which gradle' as the first command of your build. You may need to use a different Docker image for your build environment that does have Gradle installed.
Also, are there any logs related to networking as part of that log? The Docker image may also be storing gradle as a zip file for performance reasons. Which isn't caching related as no networking would occur in that case.
The caches we have provided store the dependencies that gradle provides. You can verify the cache has the files you expect by running 'ls -Ra ~/.gradle'.
Thanks,
Phil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.