I am using the jenkins dsl plugin multibranchpipeline job(https://jenkinsci.github.io/job-dsl-plugin/#path/multibranchPipelineJob) to create a multi branch pipeline. I have created jenkinsfile which handles the build jobs for each branches. I couldnt figure out how the github push trigger can be enabled through pipeline as code. All the examples I could find are using the jenkins web UI or the pollscm option. Can someone please help on how this can be enabled through code.

1 Answers

0
aquero On Best Solutions

In jenkins dsl multibranchpipeline, i was using the git branchsource at first. Then push events were not triggering builds. After i started using github branchsource, push events were automatically generating builds.