Jenkins doesn't fetch the correct Gerrit branch

强颜欢笑 提交于 2019-12-23 10:09:30

问题


I want jenkins to test the code for review. The jenkins job is started on a push to refs/for/master but it tries to build the origin/master branch and not the refs/changes/XX/X/X branch. Has somebody an idea what i did wrong?

Log from 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 config:

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

回答1:


Sorry i haven read the documentation carefully enough...

what was missing in the Git config:

Choosing strategy: Gerrit Trigger



来源:https://stackoverflow.com/questions/11121799/jenkins-doesnt-fetch-the-correct-gerrit-branch

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!