我们在Jenkins中使用gerrit-trigger,当推送新的变更集进行审核时会触发构建 .
现在我们要介绍管道并使用解决方案Defining a pipeline in scm
因此,我们期望在构建被触发时,管道插件下方可以检查此refspec
但是 ${GERRIT_REFSPEC}
在这里没有效果,它仍然检查主人
> git rev-parse refs/remotes/origin/master^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision adf5d360582b1b24f088cfa8ac0f0ebf64a57692 (refs/remotes/origin/master)
Commit message: "DO:CI End of summer"
> git config core.sparsecheckout # timeout=10
> git checkout -f adf5d360582b1b24f088cfa8ac0f0ebf64a57692
有什么建议它是如何工作的?
3 回答
我想你需要设置:
重要提示:不要忘记取消选中“ Lightweight checkout ”选项 .
或者你可以在Jenkins的工作中使用 .
Refspec:$
分支说明符:FETCH_HEAD .
取消选中“轻量级结账”就够了! gerrit-trigger插件应该提到这个!我浪费了半天!