[英]How to re-run Parameterized Jenkins Job again via code (without using rebuild plugin through UI)?
I have 80 jenkins jobs which I want to re-build programmatically.我有 80 个 jenkins 工作,我想以编程方式重新构建它们。 All 80 were run with different set of parameters.
所有 80 个都使用不同的参数集运行。 I can see 2 approaches here for job x which is inside a view as well as folder,
我可以在这里看到 2 种方法,用于在视图和文件夹中的作业 x,
Rebuild plugin is something which essentially does 1) but I want to do the same via code.重建插件本质上是 1) 但我想通过代码做同样的事情。 Please suggest specific solution if possible instead of generic API links.
如果可能,请建议具体的解决方案,而不是通用的 API 链接。 I have gone through all XML, JSON and Python API for Jenkins but there isn't one straightforward way I could find.
我已经浏览了 Jenkins 的所有 XML、JSON 和 Python API,但我找不到一种直接的方法。 Thanks.
谢谢。
After trying for a while, I was able to come up with a groovy script which upon running in jenkins-server-url/script does the trick.尝试了一段时间后,我想出了一个 groovy 脚本,它在jenkins-server-url/script中运行时可以解决问题。
The script is hosted at https://github.com/nirzari/groovy-scripts/blob/master/rebuild.groovy该脚本托管在https://github.com/nirzari/groovy-scripts/blob/master/rebuild.groovy
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.