#1788  Able to specify multiple paths in same cache step
Released
jbauer opened 2 months ago

I am mainly using Gradle to build projects and I am also using a custom docker image to run Java based jobs. The docker image pre-configures some Gradle/Maven settings for the root user by placing /root/.gradle/gradle.properties, /root/.gradle/init.gradle, /root/.m2/settings.xml and /root/.mavenrc inside the image.

Now if I want to cache Maven data it is relatively simple by caching /root/.m2/repository. However for Gradle the .gradle folder contains many directories and I would need to define a cache per directory. Ideally I want to cache .gradle and exclude some files like the ones mentioned above. However if OneDev would allow excludes it must also make sure that unpacking .gradle does not replace the existing .gradle folder and we do not loose files already present in that folder. Otherwise the running job container would not have the pre-configured Gradle settings anymore.

.gradle contents: gradle.png

Instead of excludes OneDev could alternatively allow multiple cache paths in a single cache. Currently it only allows a single cache path.

Robin Shen commented 2 months ago

I can understand the pain. Will support multiple cache paths in future versions.

jbauer commented 2 months ago

Any chance to also consider exclude rules? Otherwise one has to regularly check if something in the build tool might have changed and additional folders need to be cached.

Would be way simpler to say "Please cache .gradle but exclude gradle.properties and init.gradle".

Robin Shen changed title 1 month ago
Previous Value Current Value
Build cache excludes / multiple folders in same cache?
Able to specify multiple paths in same cache step
OneDev changed state to 'Closed' 1 month ago
Previous Value Current Value
Open
Closed
OneDev commented 1 month ago

State changed as code fixing the issue is committed (71c8f014)

OneDev changed state to 'Released' 1 month ago
Previous Value Current Value
Closed
Released
OneDev commented 1 month ago

State changed as build #4819 (10.3.3) is successful

issue 1 of 1
Type
Improvement
Priority
Normal
Assignee
Labels
No labels
Issue Votes (0)
Watchers (3)
Reference
onedev/server#1788
Please wait...
Page is in error, reload to recover