简体   繁体   中英

Triggering a multibranch pipeline job from github enterprise webhook

I am attempting to trigger multi-branch pipeline jobs from a GitHub enterprise server. I have the webhook configured to send a notification on all events. The event log on github enterprise shows that the requests to Jenkins are successful, however on the multibranch pipeline the event log is empty.

My multibranch pipeline jobs are being created using JobDSL like so:

 multibranchPipelineJob("build_${repo}") { branchSources { branchSource { source { git { id("${org}.${repo}") remote("git@${githubEntrerpise}:${org}/${repo}") } } } } configure { def traits = it / sources / data / 'jenkins.branch.BranchSource' / source / traits traits << 'jenkins.plugins.git.traits.BranchDiscoveryTrait' {} } triggers { periodic(1) // Trigger every min. } orphanedItemStrategy { discardOldItems { numToKeep(10) } } }

Is there anything I am missing here?

I resolved it by changing the webhook endpoint I was using. Changing it to the following format solved the issue http://[JENINS_HOST]/git/notifyCommit?url=git@[GIT_REPO].git

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