Is there a xsd or xml schema for job in Jenkins?

Chuck

I would like to programmatically update a job configuration by Jenkins API.

Is there a .xsd file for jenkins job configuration so that I can use it to generate a java class and in turn manipulate this java class to update jenkins job configuration?

If not, could you advise me with some more convenient way to do this?

Thanks.

sti

I have always created a template job using the Jenkins Web UI and then downloaded a copy of the configuration file from $JENKINS_URL/job/JOBNAME/config.xml

When I want to create jobs from this template, I use xml-sed (from xml coretools) to replace the values I need and then pipe it into Jenkins CLI create-job command (see $JENKINS_URL/cli/ for more information) to create new jobs. The same method can be used to update existing jobs.

It is also possible to use the Jenkins script console and execute Groovy scripts that can manipulate the internal java objects which represent jobs but I have found that to be somewhat difficult. With enough staring at http://javadoc.jenkins-ci.org/ and experimenting with script console it is definitely doable, but I would still recommend the config.xml manipulation, if for no other reason than it's easier to script it and the config.xml files can be stored in version control.

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

验证XML-Schema(xsd)错误

来自分类Dev

从xml导入Job到Jenkins

来自分类Dev

.XML-.XSD如何使用Schema XSD文件引用XML文件?

来自分类Dev

什么时候值得创建XML Schema(XSD)?

来自分类Dev

如何针对XML Schema(XSD)或RelaxNG验证JSON?

来自分类Dev

将Jenkins xml配置为基于Groovy的Jenkins Job DSL

来自分类Dev

Jenkins中是否有用于工作的xsd或xml模式?

来自分类Dev

在Jenkins Job的config.xml中管理插件版本

来自分类Dev

针对在WSO2 ESB中导入另一个xsd的Schema验证XML

来自分类Dev

XML Schema(XSD)中十进制类型的限制是什么?

来自分类Dev

XML Schema(XSD):是否可以基于另一个元素为一个元素创建规则/关系?

来自分类Dev

XML .xsd无效元素

来自分类Dev

针对XSD的XML验证

来自分类Dev

针对xml验证xsd

来自分类Dev

XSD XML验证

来自分类Dev

从XML编写XSD

来自分类Dev

XML .xsd无效元素

来自分类Dev

通过XSD验证XML

来自分类Dev

XML Java Jaxb的XSD

来自分类Dev

XML / XSD故障排除

来自分类Dev

XML XSD 验证

来自分类Dev

XML 与 XSD 验证

来自分类Dev

Xml 验证 - XSD 1.0

来自分类Dev

如何在python中将jenkins作业配置config.xml转换为YAML格式以用于jenkins-job-builder?

来自分类Dev

如何在python中将jenkins作业配置config.xml转换为YAML格式以用于jenkins-job-builder?

来自分类Dev

使用凭据插件时 jenkins-job-builder 生成错误的 xml

来自分类Dev

找不到元素'xsd:schema'的声明

来自分类Dev

找不到元素'xsd:schema'的声明

来自分类Dev

Failed to read schema document [XSD] because