Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

BitBucket Pipelines Gradle build default cache

dcmoeller May 8, 2018

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

1 answer

0 votes
Philip Hodder
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 16, 2018

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events