This message was deleted.
# community-support
s
This message was deleted.
t
How are you "setting it up"? Are you using
./gradlew
? Are you building inside an ephemeral Docker container?
d
yes I am using .gradlew and I am using the gradle jdk image -> https://hub.docker.com/_/gradle
Copy code
podTemplate(
    name: 'test-pod',
    label: 'test-pod',
    containers: [
        containerTemplate(name: 'gradle2', image: 'gradle:7.3.3-jdk11', ttyEnabled: true, command: 'cat'),
       
    ],
t
If you're using a
gradle
image, then use
gradle
(from the image) rather than
./gradlew
(which will download the distribution even if it's the same version as in the image).
As for dependency caching, AFAICT you're using ephemeral containers so it's expected to start empty and share nothing with previous builds. See https://docs.gradle.org/current/userguide/dependency_resolution.html#sub:ephemeral-ci-cache for hints.
(fwiw, we don't use Kubernetes, so our workspaces are bind-mount into the agent container and we configure the Gradle User Home inside the workspace such that everything is "cached" inside the workspace, which is reused between builds)
d
Thank you for the inputs!
@Thomas Broyer the gradle tests are not getting cached on Jenkins. It runs the tests everytime on Jenkins. (though locally the tests run only when the code has been changed. It works fine in local setup). Any pointers on how to debug this?
t
Depends on what you "cache" between builds. Look at which task has been rerun (possibly use
--console=plain
) and see what more you can cache. Maybe enable build cache and cache the
~/.gradle/caches/build-cache-1/
(or wherever you configured the local build cache to be stored), or use a remote build cache. As said above I don't really have that problem as we keep the whole gradle user home (dependencies, build cache, etc.) and the whole workspace (project's
build/
directories) so it works the same as on the developers machines.
d
Thank you Thomas! Will try out the above ways