Relocating JENKINS_HOME on Windows when installed as service

前端 未结 8 1070
野趣味
野趣味 2021-01-01 11:03

To free up space on C:, I would like to move my Jenkins data files (specifically the \\jobs directory) from the default installation directory

8条回答
  •  离开以前
    2021-01-01 11:46

    Having the same problem and not wanting to change the whole %JENKINS_HOME% location, I came across the answer by adil ameen

    Modify the config.xml file in %JENKINS_HOME% (typical under C:\Program Files (x86)\Jenkins). Change and to your desired folder.

    You can use the following placeholders: ${JENKINS_HOME}, ${ITEM_ROOTDIR}, ${ITEM_FULL_NAME}. As specified at Features controlled by system properties under jenkins.model.Jenkins.buildsDir

    Mine looks like this:

      D:/jenkins/jobs/${ITEM_FULL_NAME}/workspace
      D:/jenkins/jobs/${ITEM_FULL_NAME}/builds
    

    Reload the configuration through the Jenkins UI via Jenkins -> Manage Jenkins -> Reload configuration from disk

    You can even keep your build history if you copy the old jobs to the new location.

提交回复
热议问题