• システム開発に関わる内容をざっくりと書いていく

Changing Jenkins Workspace

Surprisingly, there are few resources that cover this topic.

Method 1: Use a Custom Workspace in the Job

  1. Go to Advanced Settings.
  2. Check the option for Use Custom Workspace and enter the desired folder path.
高度な設定
カスタムワークスペースを使用にチェックを入れ、フォルダを入力

Method 2: Change the Home Folder in jenkins.xml

Note: Changing the home folder requires a restart and re-setup.

  1. Find the jenkins.xml file in the Jenkins installation folder.
  2. Modify the env name="JENKINS_HOME" tag by entering the desired folder path for the home directory in the value attribute.

By following the above steps, the default workspace will be located in the folder: “Home Folder/workspace/Job Name”.

Note: The workspace path is technically determined by the workspaceDir setting in Jenkins’ config.xml for the Jenkins user.