我如何使用API​​更新詹金斯工作 [英] How can i update a jenkins job using the api

查看:133
本文介绍了我如何使用API​​更新詹金斯工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要创建/使用其API,因为我所有的工作都在使用它也使用其他脚本参数更新詹金斯的工作,我想集中脚本所以当我在一个地方改变它的变化反映在所有。

I have to create/update a jenkins job using its api because all of my jobs are using parameters which are also used by other scripts and I am trying to centralize the scripts so when i change it in one place, the change reflects in all.

目前,如果有人改变了剧本,他们也必须手动编辑詹金斯作业的参数以及

currently, if someone changes the script, they they also have to manually edit the parameters of the jenkins job as well.

我看到了远程API的例子创造就业机会,并能成功地创建测试工作,但我怎么能除了删除,然后重新创建它(这心不是一个选项,编辑现有的工作,因为我有维护构建历史)。

I saw the example of the Remote API for creating jobs and was able to successfully create test jobs but how can i edit an existing job besides deleting it and creating it again(which isnt an option as i have to maintain the build history).

推荐答案

的情况下,其他人也在寻找相同的答案,

in case anyone else is also looking for the same answer,

这似乎解决的办法是容易得多,你所要做的就是更新config.xml和发布更新后的config.xml回詹金斯和你的工作将被更新。

It appears the solution is far easier, all you have to do is update the config.xml and post the updated config.xml back to jenkins and your job will be updated.

这篇关于我如何使用API​​更新詹金斯工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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