如何将项目参数作为分支名称传递以在Jenkins中进行构建 [英] how to pass project parameter as branch name to build in Jenkins

查看:429
本文介绍了如何将项目参数作为分支名称传递以在Jenkins中进行构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道有什么方法可以传递项目参数的值作为构建的Git分支.

I am wondering is there any way we can pass the value of project parameter as the Git branch to build from.

以下是我要执行的操作:

Below is what I am trying to do:

  1. 使用构建参数创建Jenkins管道项目:

  1. 然后我尝试使用project参数将其传递给(构建分支)

但是从项目参数中无法解析branch_name变量.

However the branch_name variable is not resolved from the project parameter.

我可以为每个版本手动更改分支名称,但这远非理想.

I could do manually change branch name for every build, but it is far from ideal.

有任何想法吗?

推荐答案

已多次报告此问题.如果禁用轻型结帐",则此功能有效.显然,如果您使用的是轻量级结帐,则代码路径会非常不同,而且显然还没有解决.

This issue has been reported several times. This works if you disable the "Lightweight Checkout". Apparently the code path is very different if you are using the lightweight checkout, and that has not been resolved, apparently.

请参见 JENKINS-28447

这篇关于如何将项目参数作为分支名称传递以在Jenkins中进行构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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