Jenkins and Gitlab: Webhook isn't running

I have a couple of servers:

  • Jenkins
  • Gitlab
  • On gitlab, I have a webhook:

    On Push events -> http://{jenkinsIP}:8080/gitlab/build_now
    

    On Jenkins, I have a job:

    Source Code Management:

    Git:

    Repository URL : git@{GitlabIP}:{Gitlabgroup}/{project}.git (copy from gitlab)
    

    Credential: key-pair working

    Branches to build: */master

    Repository browser: gitlab

    url: http://{GitlabIP}/{Gitlabgroup}/{project}
    

    Version: 6.5.1

    Poll SCM

    Schedule H/1 * * * *
    

    Any clue why Jenkins isn't running the job?


    在Jenkins上,您应该禁用"Poll SCM"并将"Branches to build""master" (而不是"*/master"


    You don't have to put a schedule in the "poll SCM" box, it's enough to enable this option. (even if jenkins warns you (yellow), that nothing will ever happen). Then, the webhook at gitlab does his job. I configured my stuff following http://juristr.com/blog/2014/01/git-flow-jenkins-gitlab/ and it works


    There could be multiple problems.

    For one, I don't see why you create a WebHook on Gitlab, and use Poll SCM on Jenkins: either use Trigger builds remotely on Jenkins with a WebHook on Gitlab, or Poll SCM on Jenkins but then also enable some Credentials for the git repo on Jenkins' side (most probably SSH deploy key).

    Other than that, builds are actually triggered if the git repo changes: what branches are configured on Jenkins' side ?

    Note, I haven't tested the Gitlab plugin for Jenkins yet.

    链接地址: http://www.djcxy.com/p/85110.html

    上一篇: 从GitLab推送到Azure

    下一篇: Jenkins和Gitlab:Webhook没有运行