修改Jenkins存储目录

注意:在Jenkins运行时是不能更改的. 请先将Jenkins停止运行。

1、windows环境下更改JENKINS的主目录

Windows环境中,Jenkins主目录默认在C:Documents and SettingsAAA.jenkins 。可以通过设置环境变量来修改,例如: JENKINS_HOME=C:jenkins,然后重新启动jenkins。

2、Linux环境更改Jenkins的主目录

Linux环境中,Jenkins主目录默认在/root/.jenkins,Jenkins储存所有的数据文件在这个目录下. 你可以通过以下几种方式更改:

1、使用你Web容器的管理工具

设置JENKINS_HOME环境参数.打开tomcat的bin目录,编辑catalina.sh文件。在# OS specific support. $var must be set to either true or false.上面添加:export JENKINS_HOME=""

在引号中填入你的路径。

2、在启动Web容器之前设置JENKINS_HOME环境变量.

用root用户登录,编辑profile文件:vi /etc/profile,在最后加入:export JENKINS_HOME=xxxx,保存,退出后执行:source /etc/profile让配置生效

3、(不推荐)更改Jenkins.war(或者在展开的web容器)内的web.xml配置文件)

xml 复制代码
<!-- 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>
<!-- 在<env-entry-value>节点中填入路径,windows系统建议使用/分隔路径 -->
相关推荐
张太行_8 分钟前
Linux静态库:多模块高效管理
linux·运维·服务器
wgl6665201 小时前
Linux---基础IO!
linux·运维·服务器
Ancelin安心1 小时前
kali-dirsearch的使用
linux·运维·服务器·python·计算机网络·web安全·网络安全
jun_bai2 小时前
python+Java的网盘程序升级版。无感知备份文档,保护数据资产利器。
运维·服务器
suzhou_speeder2 小时前
PoE 延长器:突破 PoE 距离限制,优化网络灵活部署方案
运维·网络·poe·poe交换机·poe延长器
月光下的麦克3 小时前
如何查案动态库版本
linux·运维·c++
EndingCoder3 小时前
索引类型和 keyof 操作符
linux·运维·前端·javascript·ubuntu·typescript
liux35283 小时前
Web集群管理实战指南:从架构到运维
运维·前端·架构
石小千3 小时前
Linux清除缓存
linux·运维
weixin_516023073 小时前
VESTA在Linux下的安装
linux·运维·服务器