Jenkins没有获取正确的Gerrit分支

时间:2012-06-20 14:28:19

标签: git jenkins gerrit

我希望jenkins测试代码以供审核。 jenkins作业是在push to 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 config:

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

Gerrit Trigger配置:

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

1 个答案:

答案 0 :(得分:5)

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

Git配置中缺少的内容:

Choosing strategy: Gerrit Trigger

enter image description here