Jenkins and Gitlab: Webhook isn't running

后端 未结 4 2057
时光取名叫无心
时光取名叫无心 2021-02-20 17:47

I have a couple of servers:

  1. Jenkins
  2. Gitlab

On gitlab, I have a webhook:

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


        
相关标签:
4条回答
  • 2021-02-20 18:02

    The GitLab plugin is awesome. Follow the instructions and everything works like a charm. It is also described how to send back information to GitLab from jenkins: https://github.com/jenkinsci/gitlab-plugin/wiki/Setup-Example. I faced problems with the GitLab webhook to jenkins due to https connection (500 error). I fixed it including the SSL cert in the GitLab server: https://gitlab.com/gitlab-org/gitlab-ce/issues/2681

    0 讨论(0)
  • 2021-02-20 18:12

    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.

    0 讨论(0)
  • 2021-02-20 18:18

    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

    0 讨论(0)
  • 2021-02-20 18:22

    On Jenkins, you should disable "Poll SCM" and set the "Branches to build" to "master" (not "*/master")

    0 讨论(0)
提交回复
热议问题