如何在 Jenkins 上的 Git 中构建特定提交?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/39589595/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 12:17:28  来源:igfitidea点击:

How do I build on specific commit in Git on Jenkins?

gitsvnjenkins

提问by virendrao

I am trying to build my project from a specific commit, in Jenkins.

我正在尝试从 Jenkins 中的特定提交构建我的项目。

I have specified the branch to build and it's building from the HEAD commit.

我已经指定了要构建的分支,它是从 HEAD 提交构建的。

However I want to build from any specific revision/commit.

但是我想从任何特定的修订/提交中构建。

I tried passing a GIT_COMMITvalue as a parameter but it's picking up the HEAD commit only.

我尝试将GIT_COMMIT值作为参数传递,但它仅获取 HEAD 提交。

I also tried using svn type thing like https://svn-url@$REVISIONwhere REVISION is parameter passed in build.

我也尝试使用 svn 类型的东西,比如https://svn-url@$REVISION在构建中传递参数的地方。

For git it doesn't recognize ssh://git-url@REVISION.

对于 git,它无法识别ssh://git-url@REVISION.

回答by Gleb Egunov

  1. Jenkins Git plugin should be
  2. Copy your commit hash and paste it into "Branch Specifier"
  1. Jenkins Git 插件应该是
  2. 复制您的提交哈希并将其粘贴到“分支说明符”中

enter image description hereThen Run "Build now"

在此处输入图片说明然后运行“立即构建”