Jenkins 在哪里存储它运行的作业的配置文件? [英] Where does Jenkins store configuration files for the jobs it runs?

查看:112
本文介绍了Jenkins 在哪里存储它运行的作业的配置文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Jenkins 向工作中的 EC2 项目添加持续集成.Jenkins 机器本身保存在一台 EC2 机器上——这台机器可能需要在任何时候脱机并带回到一个完全不同的 EC2 实例上.我们有一堆 Puppet 清单,让我们可以轻松地在 EC2 实例上重新安装软件,但自定义配置文件(例如我在 Jenkins 中创建的作业的配置文件)将在移动后被删除.

I'm adding continuous integration to an EC2 project at work using Jenkins. The Jenkins machine itself is kept on an EC2 machine - one that might need to be taken offline and brought back on an entirely different EC2 instance at any point. We have a bunch of Puppet manifests allowing us to easily reinstall the software on the EC2 instance, but custom configuration files, like the ones for the jobs I create in Jenkins, would be deleted after the move.

现在,如果 Jenkins 将要在其上运行的作业存储在一个 XML 文件或一组 XML 文件中,我可以设置一个系统,将这些文件提交到版本控制服务器,然后下载回新创建的服务器作为 puppet 清单的一部分.有谁知道这些文件存储在哪里?我试过复制 /var/lib/jenkins/jobs,但这似乎存储了 Jenkins 作业的输出,而不是输入.

Now, if Jenkins stores what jobs are to be run on it in an XML file or set of XML files somewhere, I could set up a system where those files are committed to the version control server, and then downloaded back to a newly-created server as part of the puppet manifest. Does anyone know where these files are stored? I've tried copying /var/lib/jenkins/jobs, but that appears to store the output of Jenkins' jobs, not the input.

推荐答案

Jenkins 存储一些相关的构建数据,如下所示:

Jenkins stores some of the related builds data like the following:

  • 工作目录存放在目录{JENKINS_HOME}/workspace/中.

  • 每个作业在目录中存储其相关的临时工作区文件夹{JENKINS_HOME}/workspace/{JOBNAME}

存储在目录 {JENKINS_HOME}/jobs/ 中的所有作业的配置.

The configuration for all jobs stored in the directory {JENKINS_HOME}/jobs/.

  • 每个作业在目录中存储其相关的构建数据{JENKINS_HOME}/jobs/{JOBNAME}

每个作业文件夹包含:

  • 作业配置文件{JENKINS_HOME}/jobs/{JOBNAME}/config.xml

作业构建存储在{JENKINS_HOME}/jobs/{JOBNAME}/builds/

请参阅 Jenkins 文档,了解可视化表示和更多详细信息.

See the Jenkins documentation for a visual representation and further details.

JENKINS_HOME
 +- config.xml     (jenkins root configuration)
 +- *.xml          (other site-wide configuration files)
 +- userContent    (files in this directory will be served under your http://server/userContent/)
 +- fingerprints   (stores fingerprint records)
 +- nodes          (slave configurations)
 +- plugins        (stores plugins)
 +- secrets        (secretes needed when migrating credentials to other servers)
 +- workspace (working directory for the version control system)
     +- [JOBNAME] (sub directory for each job)
 +- jobs
     +- [JOBNAME]      (sub directory for each job)
         +- config.xml     (job configuration file)
         +- latest         (symbolic link to the last successful build)
         +- builds
             +- [BUILD_ID]     (for each build)
                 +- build.xml      (build result summary)
                 +- log            (log file)
                 +- changelog.xml  (change log)

这篇关于Jenkins 在哪里存储它运行的作业的配置文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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