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

          [JENKINS-23571] Option to control repos cache path directory

          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.

          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.

          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.

          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.

          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

          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

          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.

          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.

          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

          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

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

              Created:
              Updated:
              Resolved: