This is my solution for a little different purpose: use a .m2 cache for
common libs.
https://github.com/liejuntao001/jenkins-k8sagent-lib/blob/a6ced3975e37fe559c0ae8a918ed01b6920f1efa/resources/podtemplates/base.yaml#L24
The idea is to make a docker image with the most used artifacts(external
dependencies) in .m2 folder.
At the launch of the Agent, copy them to workspace's .m2 folder from the
image.

This should be adapted to fit your needs.
I assume you are not going to run concurrent builds for a job to avoid
concurrent write, if you want a job has a dedicated cache.
At the end of a build, create a docker image based on the existing .m2
content and push back for next time use.

If you are going to run concurrently builds, this idea of a sharing cache
is invalid, I think.

On Tue, Jul 10, 2018 at 8:05 AM Enguerrand A <
allamel.enguerr...@thalesaleniaspace.com> wrote:

> Hello everyone,
>
> I use the Kubernetes plugin for Jenkins to launch all Jenkins jobs in a
> Kubernetes cluster. For better performance, I want to use a persistent
> disk for the cache of different job Maven with insulation of it, ie a disk
> space per job (to separate the cache)
>
> Do you have ideas for automatic solutions with the Kubernetes plugin to
> have cache on the .m2 (or another type of cache) with a different disk by
> jobs ?
>
> Thank you in advance !
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/de71d26c-115e-4679-af8e-0151fbb3b8c9%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/de71d26c-115e-4679-af8e-0151fbb3b8c9%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Thanks,
Baibai

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAMRm5jbRhhtF5S4bzzT%3Du7La4sggNW2c-kEAjVMaqBeBK6cHPg%40mail.gmail.com.

Reply via email to