简体   繁体   中英

webhooks for jenkins multibranch pipeline jobs

I configured webhooks in my github repository with events "Send me everything.". If i create any new branch in repository, github is delivering the webhooks perfectly, but build is not triggered in jeknins job . Configured jenkins multibranch pipeline job with this repository, but i am unable to find options like "GitHub hook trigger for GITScm polling" and "GitHub Pull Request Builder" like in freestyle/maven jobs. do i need to install any plugins? any help appreciated.

attaching screenshot of my job's configuration.

I went through similar queries in stackoverflow, but i didn't find any clue. all answers are based on freestyle/maven jobs.

作业配置

Ensure your Jenkinsfile contains a check for "GitHub hook trigger for GITScm polling". This can be done by declaring the following in your Jenkinsfile:

pipeline {
    triggers {
        githubPush()
    }
}

Link to documentation: https://jenkinsci.github.io/job-dsl-plugin/#method/javaposse.jobdsl.dsl.helpers.triggers.TriggerContext.githubPush

You just have to add the below Url :

http://yourjenkins/project/*yourprojectname* on "Add Webhook" in git service provider.

No configuration required in Jenkins multibranch job it will automatically start the branch indexing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM