git 通过 Jenkins 标记一个 GitHub 项目
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8565108/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Tagging a GitHub project through Jenkins
提问by Jason Gritman
Our team has recently moved from a locally hosted Subversion repository to a private GitHub repository. In the past, when we had a build that we were ready to mark as 'released', we would use the 'Tag this build' sidebar link to add a SVN tag on the contents of the build.
我们的团队最近从本地托管的 Subversion 存储库迁移到了私有 GitHub 存储库。过去,当我们有一个准备标记为“已发布”的构建时,我们会使用“标记此构建”侧边栏链接在构建的内容上添加一个 SVN 标记。
With the move to GitHub, I have tagging of a build working in Jenkins, but it only seems to tag the build locally. The tag displays up if I run git tag
in the workspace directory, but it never gets pushed to GitHub.
随着迁移到 GitHub,我标记了在 Jenkins 中工作的构建,但它似乎只在本地标记构建。如果我git tag
在工作区目录中运行,则会显示该标签,但它永远不会被推送到 GitHub。
Is there a way to have Jenkins push a tag to a remote repository whenever the build is tagged through Jenkins?
每当构建通过 Jenkins 进行标记时,有没有办法让 Jenkins 将标记推送到远程存储库?
采纳答案by Kohsuke Kawaguchi
This feature simply doesn't exist yet. Please file a ticket in the issue tracker. I agree that this is an important use case.
这个功能根本不存在。请在问题跟踪器中提交工单。我同意这是一个重要的用例。
回答by manojlds
Select 'Push GIT tags back to origin repository' from the post-build actions (this is required to update your centralised git repo with the results of the build).
从构建后操作中选择“将 GIT 标签推回原始存储库”(这是使用构建结果更新集中式 git 存储库所必需的)。
https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin#GitPlugin-AdvancedFeatures
https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin#GitPlugin-AdvancedFeatures