Linux system modifies the Jenkins default home directory
Because the default home directory space for Jenkins is too small, the default directory needs to be modified in production to other directories. In a Linux environment, the Jenkins home directory defaults to/root/.jenkins
Note: The online Jenkins service needs to be cautious,/root/.jenkins there are configuration and plug-ins, please try in the test environment first.
1. Stop Jenkins, open the Tomcat bin directory, SH shutdown.sh
2. Configure the variable (in this case, replace the directory to/usr/local/jenkins, this Jenkins directory does not need to be created manually)
Edit the catalina.sh file in the bin directory
In # OS specific support. $var _must_ is set to either True or false. Add a row above
Export Jenkins_home=/usr/local/jenkins
Edit Profile: Vi/etc/profile
In the last join: Export jenkins_home=/usr/local/jenkins
Save, refresh Global environment variable Source/etc/profile
Restart Tomcat,sh startup.sh
3. Testing
Browser input HTTP://IP: Port/jenkins, interface appears
cat/usr/local/jenkins/Secrets/initialadminpassword
The encrypted string can be pasted in, and then in the System management-system settings to see the home directory is already/usr/local/jenkins
Linux system modifies the Jenkins default home directory