简体   繁体   English

如何在多个 Jenkins 作业中大量添加构建后操作

[英]How to massively add post-build action in multiple Jenkins jobs

Subject is self-explanatory.主题是不言自明的。 I'd like to add post-build actions for many Jenkins jobs, instead of configuring one by one.我想为许多 Jenkins 作业添加构建后操作,而不是一一配置。 I added Configuration Slicing plugin but if I'm not mistaken it doesn't modify post-build actions.我添加了Configuration Slicing插件,但如果我没记错的话,它不会修改构建后的操作。 Any ideas?有任何想法吗?

Thanks in advance提前致谢

If Configuration Slicing Plugin doesn't satisfy your requirments, then you should fall back to SED.如果配置切片插件不能满足您的要求,那么您应该回退到 SED。

From Jenkins Issues :詹金斯问题

You will need to write a script that will loop through your Jenkins jobs and SED the value with a new one then use POST https://support.cloudbees.com/hc/en-us/articles/218353308-How-to-update-job-config-files-using-the-REST-API-and-cURL您将需要编写一个脚本来循环遍历您的 Jenkins 作业并使用新的 SED 值,然后使用 POST https://support.cloudbees.com/hc/en-us/articles/218353308-How-to-update -job-config-files-using-the-REST-API-and-cURL

  1. Get current config获取当前配置
    curl -X GET http://developer:developer@localhost:8080/job/test/config.xml -o mylocalconfig.xml curl -X GET http://developer:developer@localhost:8080/job/test/config.xml -o mylocalconfig.xml

  2. Post updated config发布更新的配置
    curl -X POST http://developer:developer@localhost:8080/job/test/config.xml --data-binary "@mymodifiedlocalconfig.xml" curl -X POST http://developer:developer@localhost:8080/job/test/config.xml --data-binary "@mymodifiedlocalconfig.xml"

For the Pos-build actions is the markups between <publishers>...</publishers> in the config.xml对于 Pos-build 操作是config.xml <publishers>...</publishers>之间的标记

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM