Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Change the home directory of Jenkins

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

Description

Jenkins sometimes needs to be migrated, and the home directory will change. This article focuses on how to change the home directory. Due to the different installation methods of jenkins, the home directory is also different. This test environment: Centos6.8 X64. Note: before changing the home directory, be sure to back up the original home directory, because the jenkins directory exists as a file, just package the entire home directory.

How to view the current Jenkins home directory: system management → system settings → home directory → / var/lib/jenkins

I. installed through yum or rpm package

This installation generates a / etc/sysconfig/jenkins file, and the default home directory is / var/lib/Jenkins. You only need to modify this configuration file and restart the jenkins service to change the home directory. Here we take changing to / home/jenkins as an example.

Stop the jenkins service

Service Jenkins stop

Back up home directory data

Tar-zcvf / backup/jenkins.tar.gz / var/lib/jenkins

Migrate the old home directory data to the new home directory

Tar-zxvf / backup/jenkins.tar.gz-C / home/Jenkins

Edit configuration file

Vim / etc/sysconfig/Jenkins

Change to the changed directory

JENKINS_HOME= "/ home/jenkins"

Change the directory owner

Chown-R jenkins.jenkins / home/Jenkins

Restart

Service jenkins restart

II. The first method of installation through tomcat

Open the bin directory of tomcat and edit the catalina.sh file.

In # OS specific support. $var _ must_ be set to either true or false. Add above:

Export JENKINS_HOME= "/ home/jenkins"

Method two

Set the JENKINS_HOME environment variable before starting the Web container.

Edit the profile file: vi / etc/profile

Add at the end of the document

Export JENKINS_HOME=/home/Jenkins

Make the configuration file effective

Source / etc/profile

When finished, remember to restart tomcat.

Finally, for jenkins under windows, please refer to: http://www.cnblogs.com/itech/archive/2011/11/04/2236230.html

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report