如何使用 groovy 脚本在 jenkins 中获取特定作业的所有构建号? [英] How can I get all build numbers of particular job in jenkins using groovy script?
本文介绍了如何使用 groovy 脚本在 jenkins 中获取特定作业的所有构建号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用主动选择插件,使用 groovy 脚本检索 Jenkins 中所有作业的名称.我可以编写一个 groovy 脚本来让我列出该特定作业的所有版本号.
I am using active choice plugin, have groovy script which retrieves names of all jobs in Jenkins. Can I write a groovy script which get me list of all the build numbers of that particular job.
推荐答案
为了使用活动选择插件获取特定作业的构建列表,您可以使用以下示例.
In order to get a list of builds for a particular job using the active choice plugin, You can use the following example.
首先,创建一个用于检索作业名称的活动选择参数:
First, create an active choice parameter for retriving the job names:
然后创建一个活动选择参数以从所选作业中检索内部版本号:
Then create an active choice parameter for retriving the build numbers from the selected job:
这篇关于如何使用 groovy 脚本在 jenkins 中获取特定作业的所有构建号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文