Change the home directory of Jenkins

Modify during installation:

1) The default home directory of jenkins is placed in the .jenkins directory under the current user's home directory path . If jenkins is started with the root user, the home directory is /root/.jenkins

2) You can manually set the jenkins home directory in the system environment variable, so that after starting jenkins, the jenkins data will be written to the manually set home directory.

Add to environment variables:

JENKINS_HOME= "/data/jenkins"
export  JENKINS_HOME

Effective environment variable modification:

 source .base_profile

Modified after using for a while:

3) If jenkins has been used for a period of time, stop the jenkins service and move the entire directory of the original home directory to the new path mv  /root/.jenkins /data/

The process of operation 2)

Restart jenkins and see what's in the jenkins interface. Don't worry, you can look at the system configuration in the jenkins interface, the main directory has become /data/.jenkins

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325893557&siteId=291194637