git jenkins 和标签一起

发布于 2025-01-05 05:25:52 字数 711 浏览 4 评论 0原文

有没有办法让詹金斯签出并构建某个标签(参数化构建?) 我目前正在构建开发(主分支),并在标记版本后(使用 maven:release

一些信息(按照 Vonc 的建议)
环境是win7,最新的git,最新的jenkins(昨天更新)。 我尝试将标签名称放入 Branch Specifier 中,但没有成功(要么失败,要么检查 master 分支)。 来自詹金斯日志:

从 1 个远程 Git 存储库获取更改从 [email protected]:${myorgname}/${myorgname}.git

我猜问题确实是 -我在哪里(如果有)告诉詹金斯 - “嗨,不要签出主分支,只需签出标签”。 有没有地方可以自己配置git命令? (例如 - git fetch my_tag

Is there any way to make jenkins checkout and build a certain tag (parameterized builds?)
I'm currently building the development (master branch) and right after tag a version (using maven:release)

some information (as suggested by Vonc)
Env is win7, latest git, latest jenkins (updated yesterday) .
I've tried placing the tag name in the Branch Specifier but without luck (either it fails or checking out the master branch).
from jenkins log:

Fetching changes from 1 remote Git repository Fetching upstream changes from [email protected]:${myorgname}/${myorgname}.git

I'm guessing the question is really - where (if any) do I tell jenkins - "hi, don't checkout master branch, just checkout the tag".
Is there a place I can configure the git command myself? (e.g - git fetch my_tag)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

雪若未夕 2025-01-12 05:25:52

如果您想让 Jenkins 从 git 标签构建,请在标有“要构建的分支”的框中输入标签名称。您可以将分支名称、标签甚至 git 修订版本放入框中。

如果它不适合您,您确定已将标签推送到 Jenkins 从中提取的存储库吗?除非你告诉它,否则git push不会推送标签。

If you want to make Jenkins build from a git tag, you enter the tag name into the box labeled "Branches to build". You can put a branch name, a tag or even a git revision into the box.

If it is not working for you, are you sure you have pushed the tag to the repository where Jenkins is pulling from? git push does not push tags unless you tell it to.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文