我可以让 Jenkins 从传入的参数构建一个 git 标签吗? [英] Can I get Jenkins to build a git tag from a passed in parameter?

查看:24
本文介绍了我可以让 Jenkins 从传入的参数构建一个 git 标签吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Jenkins 支持参数化构建.

Jenkins supports parametrized builds.

我有一个部署版本,需要通过参数指定要部署的标签.(将特定标签部署到生产环境)

I have a deployment build that requires the tag to deploy to be specified via a parameter. (to deploy a particular tag to production)

有没有一种简单的方法可以使用 git 插件来做到这一点?

Is there an easy way to do this with the git plugin?

我尝试添加参数 TAG_NAME,然后将作业的 git 插件部分中的 branch_specifier 设置为 $TAG_NAME.不工作.我明白了:

I tried adding a parameter TAG_NAME, and then setting branch_specifier in the git plugin section of the job to $TAG_NAME. Dosen't work. I get:

ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.

有什么想法吗?

推荐答案

使构建参数化,并在 git URL 框中输入您定义的变量的名称.例如:${GIT_URL}.应该这样做.

Make the build parameterized and in the git URL box, put the name of the variable you've defined. For example: ${GIT_URL}. This should do it.

这篇关于我可以让 Jenkins 从传入的参数构建一个 git 标签吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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