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

Option to control repos cache path directory

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      I would like to see an option to change the hgcache folder path location. Having this on another drive then the jenkins installation path would be useful, just like I can change the workspace directory. Normally I install the OS on a drive, jenkins and custom service on different partition and have a separated physical drive for scratch (workspace). I would like to include the hgcache onto the scratch drive (this way my setup have very little writing on the OS/application drive/partition (which is backuped) and write a lot on a non backuped drive that can be swap without impact (drive is dead just replace it and mount it at the same place).

      I took a look at the source code of the plugin, I guess the following line should be modified to use a variable instead:

      Cache.java:

      FilePath masterCaches = master.getRootPath().child("hgcache");
      FilePath localCaches = node.getRootPath().child("hgcache");
      104: FilePath masterCaches = master.getRootPath().child("hgcache");

      158: FilePath localCaches = node.getRootPath().child("hgcache");

      There's also some log trace that would need to be changed.

      This is a quick feature request that could enchance the configuration of this plugin. Thanks

        Attachments

          Activity

          Hide
          jglick Jesse Glick added a comment -

          Would be useful to have it be possible to configure the master cache location much as you do for master workspace locations. The workaround would be to use a symlink.

          Not necessary for slaves, since the slave FS root (including workspaces, tools, HG caches, and so on) can just be tossed out and recreated at any time.

          Show
          jglick Jesse Glick added a comment - Would be useful to have it be possible to configure the master cache location much as you do for master workspace locations. The workaround would be to use a symlink. Not necessary for slaves, since the slave FS root (including workspaces, tools, HG caches, and so on) can just be tossed out and recreated at any time.
          Hide
          jeromegodbout Jerome Godbout added a comment -

          I agree for the slave, it would not be necessary. As for the workaround, if I was on Unix system I would have done that a long time ago, but sadly I'm stuck under Windows and symlink under Windows for different drives at boot is a mess. Which make me think, could have the path on the master configurable and fallback to the actual if path is not found.

          Show
          jeromegodbout Jerome Godbout added a comment - I agree for the slave, it would not be necessary. As for the workaround, if I was on Unix system I would have done that a long time ago, but sadly I'm stuck under Windows and symlink under Windows for different drives at boot is a mess. Which make me think, could have the path on the master configurable and fallback to the actual if path is not found.
          Hide
          mryan Manuel Ryan added a comment -

          I have the same need, I manage a lot of jenkins masters and I want the hgcache directory to be outside of $JENKINS_HOME for storage and backup reasons. I have implemented this feature in the following PR : https://github.com/jenkinsci/mercurial-plugin/pull/91

          Show
          mryan Manuel Ryan added a comment - I have the same need, I manage a lot of jenkins masters and I want the hgcache directory to be outside of $JENKINS_HOME for storage and backup reasons. I have implemented this feature in the following PR : https://github.com/jenkinsci/mercurial-plugin/pull/91
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Manuel Ryan
          Path:
          src/main/java/hudson/plugins/mercurial/Cache.java
          src/main/java/hudson/plugins/mercurial/MercurialInstallation.java
          src/main/java/hudson/plugins/mercurial/MercurialSCM.java
          src/main/java/hudson/plugins/mercurial/MercurialSCMSource.java
          src/main/resources/hudson/plugins/mercurial/MercurialInstallation/config.jelly
          src/main/resources/hudson/plugins/mercurial/MercurialInstallation/help-masterCacheRoot.html
          src/test/java/hudson/plugins/mercurial/CacheTest.java
          src/test/java/hudson/plugins/mercurial/CachingCustomDirSCMTest.java
          http://jenkins-ci.org/commit/mercurial-plugin/bb08342f4acca377a0df2d9a607d4596b671f72d
          Log:
          JENKINS-23571 Add configuration option for cache directory location on master node.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Manuel Ryan Path: src/main/java/hudson/plugins/mercurial/Cache.java src/main/java/hudson/plugins/mercurial/MercurialInstallation.java src/main/java/hudson/plugins/mercurial/MercurialSCM.java src/main/java/hudson/plugins/mercurial/MercurialSCMSource.java src/main/resources/hudson/plugins/mercurial/MercurialInstallation/config.jelly src/main/resources/hudson/plugins/mercurial/MercurialInstallation/help-masterCacheRoot.html src/test/java/hudson/plugins/mercurial/CacheTest.java src/test/java/hudson/plugins/mercurial/CachingCustomDirSCMTest.java http://jenkins-ci.org/commit/mercurial-plugin/bb08342f4acca377a0df2d9a607d4596b671f72d Log: JENKINS-23571 Add configuration option for cache directory location on master node.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Jesse Glick
          Path:
          src/main/java/hudson/plugins/mercurial/Cache.java
          src/main/java/hudson/plugins/mercurial/MercurialInstallation.java
          src/main/java/hudson/plugins/mercurial/MercurialSCM.java
          src/main/java/hudson/plugins/mercurial/MercurialSCMSource.java
          src/main/resources/hudson/plugins/mercurial/MercurialInstallation/config.jelly
          src/main/resources/hudson/plugins/mercurial/MercurialInstallation/help-masterCacheRoot.html
          src/test/java/hudson/plugins/mercurial/CacheTest.java
          src/test/java/hudson/plugins/mercurial/CachingCustomDirSCMTest.java
          http://jenkins-ci.org/commit/mercurial-plugin/61d78a6d791c6642b44e197b7ed74247a1602bfa
          Log:
          Merged #91: [FIXED JENKINS-23571] Add configuration option for cache directory location

          Compare: https://github.com/jenkinsci/mercurial-plugin/compare/d092eb8c7328...61d78a6d791c

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/hudson/plugins/mercurial/Cache.java src/main/java/hudson/plugins/mercurial/MercurialInstallation.java src/main/java/hudson/plugins/mercurial/MercurialSCM.java src/main/java/hudson/plugins/mercurial/MercurialSCMSource.java src/main/resources/hudson/plugins/mercurial/MercurialInstallation/config.jelly src/main/resources/hudson/plugins/mercurial/MercurialInstallation/help-masterCacheRoot.html src/test/java/hudson/plugins/mercurial/CacheTest.java src/test/java/hudson/plugins/mercurial/CachingCustomDirSCMTest.java http://jenkins-ci.org/commit/mercurial-plugin/61d78a6d791c6642b44e197b7ed74247a1602bfa Log: Merged #91: [FIXED JENKINS-23571] Add configuration option for cache directory location Compare: https://github.com/jenkinsci/mercurial-plugin/compare/d092eb8c7328...61d78a6d791c

            People

            • Assignee:
              mryan Manuel Ryan
              Reporter:
              jeromegodbout Jerome Godbout
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: