[英]GERRIT_REFSPEC is always empty in Jenkins pipeline
I've set up a Jenkins pipeline in which I want to run a Jenkinsfile, based on a Gerrit trigger.我已经建立了一个 Jenkins 管道,我想在其中运行一个基于 Gerrit 触发器的 Jenkinsfile。 I have read a lot on here about how to set this up.
我在这里阅读了很多关于如何设置的内容。 I have added the
GERRIT_REFSPEC
variable as parameter and $GERRIT_REFSPEC
under Advanced->Refspec in my pipeline.我在管道中的 Advanced->Refspec 下添加了
GERRIT_REFSPEC
变量作为参数和$GERRIT_REFSPEC
。
The issue is that GERRIT_REFSPEC
is always empty when I trigger a build from Gerrit.问题是当我从 Gerrit 触发构建时,
GERRIT_REFSPEC
始终为空。 I would expect it to contain something like "refs/changes/../.../."
我希望它包含类似
"refs/changes/../.../."
. .
GERRIT_BRANCH
and other variables are set correctly. GERRIT_BRANCH
和其他变量设置正确。 Even when I trigger a build from Jenkins by running "Build with parameters"
and overwrite the value, it's empty afterwards.即使我通过运行
"Build with parameters"
触发 Jenkins "Build with parameters"
并覆盖该值,之后它也是空的。
I have seen the error, because the Git checkout goes wrong.我已经看到了错误,因为 Git 结帐出错了。 I've also tried creating a pipeline script directly in Jenkins and echoing multiple Gerrit parameters there.
我还尝试直接在 Jenkins 中创建管道脚本并在那里回显多个 Gerrit 参数。
GERRIT_REFSPEC
seems the only one that's empty. GERRIT_REFSPEC
似乎是唯一一个空的。 All other variables contain valid information.所有其他变量都包含有效信息。
Can anyone tell me what I'm missing here?谁能告诉我我在这里想念什么? Thanks!
谢谢!
Cancel the Lightweight checkout:取消轻量级结账:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.