Triggering Branch Indexing on Multibranch Pipelines (Jenkins/Git)

后端 未结 3 541
借酒劲吻你
借酒劲吻你 2021-01-02 08:25

I\'m trying to automatically trigger \'Branch Indexing\' on a Multibranch Pipelines job in Jenkins.

At the moment, only one method seems to actually work, which is p

3条回答
  •  离开以前
    2021-01-02 08:46

    The easiest option by far (that I'm aware of) is to remotely tell the Jenkins Git plugin that there's a new commit for a defined repository. However, this will not trigger Jenkins to start a job immediately. What happens is that the Git plugin starts (re-)indexing the specific repository. The Jenkins job is then started if changes are detected.

    From your repository (GitHub, GitLab, etc.) you should trigger the following URL:

    http://my-jenkins-host/git/notifyCommit?url=git@gitlab.example.com:group/repository.git&delay=0sec

    The value for url must match the SCM URL you configured in the Jenkins job (Git plugin)!

    Gotcha: it may be that your Jenkins is not deployed under the root context (/) in which case the URL would be http://my-jenkins-host/context-path/git/...

提交回复
热议问题