Jenkins服务器运行时删除了config.xml [英] Deleted config.xml when Jenkins server was running

查看:321
本文介绍了Jenkins服务器运行时删除了config.xml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当Jenkins运行时,我删除了Jenkins源文件夹中的 "config.xml" 文件.
当我重新启动Jenkins服务时,它给出了错误:

I deleted "config.xml" file in the Jenkins source folder when Jenkins was running.
When I restarted Jenkins service, it gives Error:

Cannot read config.xml 

所有正在运行的作业的配置文件都在其中.
有什么方法可以启动Jenkins并重新配置它?

The config files for all the jobs running are there.
Is there any way through which I can start Jenkins and configure it again ?

推荐答案

您需要做的就是在JENKINS_HOME目录中创建包含以下三个元素的config.xml:

All you need is to create a config.xml in JENKINS_HOME directory with below 3 elements in it:

  • 版本
  • 工作空间目录
  • 构建目录

我已经在Jenkins实例中对此进行了测试.

I have tested this in my Jenkins instance.

<?xml version='1.0' encoding='UTF-8' ?>
<hudson>
  <version>1.581</version>
  <workspaceDir>${JENKINS_HOME}/workspace/${ITEM_FULLNAME}</workspaceDir>
  <buildsDir>${ITEM_ROOTDIR}/builds</buildsDir>
</hudson>

这篇关于Jenkins服务器运行时删除了config.xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆