At work, because the default home directory space of Jenkins is too small, the default home directory of Jenkins needs to be modified to a different directory. This article provides a detailed description of the main directory where Jenkins was changed.
Note: The Jenkins runtime cannot be changed. Please stop Jenkins from running first.
One, the Windows environment changes the home directory of Jenkins
In a Windows environment, the Jenkins home directory defaults to C:\Documents and Settings\aaa\.jenkins.
You can modify it by setting environment variables, for example: Jenkins_home=c:\jenkins, and then restarting JENKINS.
Second, the Linux environment changes the home directory of Jenkins
In a Linux environment, the Jenkins home directory defaults to/root/.jenkins
Jenkins stores all the data files in this directory. There are several ways that you can change this:
1. Use your Web container's administration tool to set the JENKINS_HOME
environment parameters.
Open the Tomcat Bin directory and edit the catalina.sh file. In # OS specific support. $var _must_ is set to either True or false. Add above: Export jenkins_home= "" Fill in the quotation marks with your path.
2. Set environment variables before starting the Web container JENKINS_HOME
.
Edit profile with Root login: Vi/etc/profile in the last join: Export jenkins_home=xxxx save, exit after execution: source /etc/profile Let configuration take effect
3, (not recommended) change Jenkins.war(
or within the expanded web container) of the XML configuration file
<!--if specified, this value is used as the Hudson home directory--><env-entry><env-entry-name>hudson_ Home</env-entry-name><env-entry-type>java.lang.string</env-entry-type><env-entry-value ></env-entry-value></env-entry><!--fill in the path in the <env-entry-value> node, the Windows system recommends using/separating the path--
Okay, now run Jenkins and look at the effect.
Jenkins Replace master Data Catalog