Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-35667

p4 plugin should give a mechanism to delete p4 clients after use

XMLWordPrintable

      I'm dealing with a situation where :

      • my Jenkins instance has lots of 'disposable' slaves (docker, vm's ...)
      • the use of p4-plugin make things works without having to install p4 client on slaves, that's very nice ! no need to fight ith credentials definition and so on. Works great.
      • jobs do not always run on the same slave
      • some jobs may run in parallel on several slaves
      • as we use the 'populate have list' option to have fast sync in incremental builds situations, we won't want to delete the p4 client everytime
      • once the jobs and / or slaves are not in use anymore, they are disposed of ... which as of today leaves a mess of p4 clients opened, with no way to delete them after.
      • note that deleting a job only deletes jenkin's workspace on last slave it's been built, so it won't work in situations where any slave can be used from a run to the other.

      We use a p4 client naming pattern looking like :

      HOSTNAME- ${JOB_NAME}-${NODE_NAME}-${EXECUTOR_NUMBER}
      

      this pattern allows no overlapping when running parallel things

      I need a mechanism available to dispose entirely of the client when it's known it won't be used anymore.

      Additionally, it would be even greater to be able to delete clients based on the naming pattern with wildcards, and not only the last used.

      I would suggest to limit this to the 'pipeline' implementation, as it requires 'logic' somewhere, that would easily be done in the groovy script of the pipeline definition.

      I'm thinking of an approach where commands like 'p4 client -d ' would me made available as groovy snippets, we could call them whenever we need.

      it seems to be the more flexible approach.

            p4paul Paul Allen
            squalou squalou jenkins
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: