在指定的回购中动态填充Jenkins选择参数与Git分支 [英] Dynamically Fill Jenkins Choice Parameter With Git Branches In a Specified Repo

查看:356
本文介绍了在指定的回购中动态填充Jenkins选择参数与Git分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个参数化的Jenkins作业,需要在特定的Git仓库中输入特定的Git分支。目前这个参数是一个字符串参数。



有没有办法让这个参数成为一个选择参数,并用Git分支动态填充下拉列表?我不想要求某人通过在每次创建新分支时手动配置下拉菜单来保持此选择参数。 解决方案

p> 扩展选择参数插件可让您阅读从文件中选择。



当然,现在您还有另外一个问题:如何确保文件是最新的(可以通过文章完成-commit hook)并传播给所有用户(可以通过将其放置在共享文件服务器上来完成)。但可能有更好的解决方案。


I have a parameterized Jenkins job which requires the input of a specific Git branch in a specific Git repo. Currently this parameter is a string parameter.

Is there any way to make this parameter a choice parameter and dynamically fill the drop down list with the Git branches? I don't want to require someone to maintain this choice parameter by manually configuring the drop down every time a new branch is created.

解决方案

Extended Choice Parameter plugin will allow you to read the choices from a file.

Of course, now you have another problem: how to make sure the file is up-to-date (that can be done with a post-commit hook) and propagated to all the users (that can be done by placing it on a shared file server). But there may be better solutions.

这篇关于在指定的回购中动态填充Jenkins选择参数与Git分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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