简体   繁体   English

Gerrit&Jenkins管道的最新变化

[英]Gerrit & Jenkins pipeline newest changes

I have a Jenkins and a Gerrit running to validate my code. 我有一个Jenkins和一个Gerrit在运行以验证我的代码。 Jenkins has the gerrit trigger plugin. Jenkins具有gerrit触发器插件。 Gerrit should trigger a declarative pipeline which gets the newest changes and build it. Gerrit应该触发一个声明性管道,该管道将获取最新的更改并进行构建。

this works: git fetch http://localhost:8081/PipelinePart1 refs/changes/87/387/1 && git checkout FETCH_HEAD 这有效:git fetch http:// localhost:8081 / PipelinePart1 refs / changes / 87/387/1 && git checkout FETCH_HEAD

but is there a way to get always the newest changes? 但是有没有办法总是获得最新的变化?

Use the $GERRIT_REFSPEC build parameter which, in your case, will be equal to "refs/changes/87/387/1". 使用$ GERRIT_REFSPEC构建参数,在您的情况下,该参数将等于“ refs / changes / 87/387/1”。 See the following image for reference: 请参见下图以供参考:

GERRIT_REFSPEC

Here is a working configuration I am using 这是我正在使用的工作配置

在此处输入图片说明

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

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