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

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

问题描述

Jenkins支持参数化构建。



我有一个部署构建,需要通过参数指定要部署的标记。 (将特定标签部署到生产中)

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



我尝试添加一个参数TAG_NAME,然后在作业的git插件部分将branch_specifier设置为$ TAG_NAME。
不能工作。我得到:

 错误:找不到任何修订版本。验证此作业的存储库和分支配置。 

有什么想法?

解决方案

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


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)

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

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.

Any ideas?

解决方案

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.

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

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