简体   繁体   English

Jenkins使用git“标记”构建

[英]Jenkins “tag” build with git

There is an option on jenkins when using git to "tag" the build. 当使用git“标记”构建时,jenkins上有一个选项。

What does this do and how do I use it? 这是做什么的,我该如何使用它? I assume I can tag the build at that version but I'm struggling to figure out how to push that tag - it's not so useful unless I can push the tag. 我假设我可以在该版本上标记构建,但我正在努力弄清楚如何推送该标记 - 除非我可以推送标记,否则它不是那么有用。

You don't always want to push all the build tags, because there could be a lot of them, depending on your build cycle. 您并不总是希望推送所有构建标记,因为可能存在很多构建标记,具体取决于您的构建周期。

But any task scheduler (like Jenkins) will tag a build in case you want to get back to that specific code and debug it (because even though the build might have succeeded, the end result might have run poorly) 但是任何任务调度程序(如Jenkins)都会标记一个构建,以防你想要回到那个特定代码并对其进行调试(因为即使构建可能已成功,最终结果也可能运行不佳)

That said, should you want to push those tags, you can use, as mentioned in " Tagging a GitHub project through Jenkins ", a post-build action ( git push --tags ). 也就是说,如果您想推送这些标签,您可以使用“ 通过Jenkins标记GitHub项目 ”中提到的构建后操作( git push --tags )。
Or, as mentioned in the ticket JENKINS-12156 , use the GitPublisher (as illustrated in " Git, Feature Branches, and Jenkins – or how I learned to stop worrying about broken builds "). 或者,如票证JENKINS-12156中所述 ,使用GitPublisher(如“ Git,Feature Branches和Jenkins - 或我如何学会停止担心破坏的构建 ”)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM