Relocating JENKINS_HOME on Windows when installed as service

前端 未结 8 1065
野趣味
野趣味 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 12:03

    Pre Jenkins 2.121

    JENKINS_HOME is where Jenkins is installed which is not what you want to change. After you start up Jenkins, go to:

    1. Manage Jenkins
    2. System Configuration
    3. Click the first "advanced" button

    This gives you text fields where you can change the directory for the workspace and builds directories. Those are the two directories that use a good bit of disk space. Note that it will not move history. If you want to move the existing workspaces/etc, you'll need to manually copy them over.

    Post 2.121 You have to set properties (not through the UI). The system property to use is jenkins.model.Jenkins.buildsDir.

    https://jenkins.io/doc/upgrade-guide/2.121/#ui-option-for-custom-builds-and-workspace-directories-on-the-master-has-been-removed https://wiki.jenkins.io/display/JENKINS/Features+controlled+by+system+properties

    0 讨论(0)
  • 2021-01-01 12:07

    Another possibility is to move the entire contents of $JENKINS_HOME.

    It does not require editing configuration files, and it preserves the build history.

    1. Stop the running service: jenkins.exe stop

    2. Uninstall the service: jenkins.exe uninstall

    3. Copy C:\Jenkins\home to F:\Jenkins\home

    4. Rename C:\Jenkins to something else, keep it as backup.

    5. Go to F:\Jenkins\home

    6. Reinstall the service: jenkins.exe install

    7. Start Jenkins: jenkins.exe start

    Enjoy the new disk space!

    0 讨论(0)
提交回复
热议问题