gpt4 book ai didi

jenkins - 如何更改 Jenkins 主目录位置?

转载 作者:行者123 更新时间:2023-12-02 04:02:04 27 4
gpt4 key购买 nike

简单问题:如何更改jenkins 主目录位置?默认情况下它指向/var/lib/jenkins 而我希望它指向/mnt/home/jenkins。我已将 $JENKINS_HOME 更改为/mnt/home/jenkins,但这对我没有帮助。

我遇到了 jenkins Ui 问题。请参阅下面的错误。如果我保留相同的/var/lib/jenkins/它工作正常。HTTP 错误:503

访问/时出现问题。原因:

Service Unavailable

由 Jetty 提供支持://

最佳答案

如果您需要在 Ubuntu 中更改 Jenkins 主目录,请按照以下说明操作:

Stop Jenkins 
/etc/init.d/jenkins stop

Create folder for new Jenkins home directory
mkdir home

Change access rights for this folder and all folders and files inside
sudo chown -R jenkins:jenkins home

Find current Jenkins folder and copy all directories and files into new one. If you don't know current Jenkins directory you can find it in /etc/default/jenkins file.
sudo -u jenkins cp -r /var/lib/jenkins/* home/

Change JENNIKS_HOME inside /etc/default/jenkins
sudo nano /etc/default/jenkins

find JENKINS_HOME and change path to new Jenkins home folder

Start Jenkins
/etc/init.d/jenkins start

In case if you have the error message
Unable to create the home directory ‘/path/to/jenkins/home’. This is most likely a permission problem.
run the command
sudo chown -R jenkins:jenkins root_folder/

To get the root_folder you need go to Jenkins home folder and run pwd. This will work in case if you want use other one hdd (not system) for Jenkins home .
$pwd
/media/path/to/jenkins/home

In my case the root_folder is media

就是这样。享受吧!

来源:http://www.sofment.com/?q=node/25

关于jenkins - 如何更改 Jenkins 主目录位置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41369329/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com