gpt4 book ai didi

git - Jenkins 没有获取正确的 Gerrit 分支

转载 作者:太空狗 更新时间:2023-10-29 13:22:35 25 4
gpt4 key购买 nike

我想让 Jenkins 测试代码以供审查。 jenkins 作业是在推送到 refs/for/master 时启动的,但它会尝试构建 origin/master 分支而不是 refs/changes/XX/X/X 分支。有人知道我做错了什么吗?

来自 Jenkins 的日志:

Triggered by Gerrit: http://localhost/13
Building on master in workspace
/var/lib/jenkins/jobs/CI-JoysteerLogApi/workspace
Checkout:workspace / /var/lib/jenkins/jobs/CI-JoysteerLogApi/workspace - hudson.remoting.LocalChannel@28071488
Using strategy: Default
Last Built Revision: Revision f604c6257923d4231b74573528d0116e0b52dc64 (origin/master)
Fetching changes from 1 remote Git repository
Fetching upstream changes from ssh://jenkinsCI@192.168.5.20:29418/JoysteerLogApi.git
Commencing build of Revision f604c6257923d4231b74573528d0116e0b52dc64 (origin/master)
Checking out Revision f604c6257923d4231b74573528d0116e0b52dc64 (origin/master)

Git 配置:

Repository URL: ssh://user@localhost:29418/Project.git
Refspec: $GERRIT_REFSPEC
Branches to build: $GERRIT_BRANCH

Gerrit 触发器配置:

Gerrit Project:
Type: Plain
Pattern: Project
Branches:
Type: Path
Pattern: **

最佳答案

抱歉,我没有仔细阅读文档...

Git 配置中缺少的内容:

Choosing strategy: Gerrit Trigger

enter image description here

关于git - Jenkins 没有获取正确的 Gerrit 分支,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11121799/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com