Search code examples
gitjenkinsgithubjenkins-pipelinemultibranch-pipeline

Jenkins - Multibranch pipeline build on push


I'm trying to setup a multi-branch pipeline project in Jenkins. Ideally, I would like the branch pipelines to be build once the developers push new code. For example, if a developer pushes to a 'dev' branch then the 'dev' pipeline will build automatically.

I know that under the "Scan Multibranch Pipeline Triggers" option you can set how often Jenkins will look for changes, but I would prefer it to be the other way around, meaning that once new code is in the branch then Jenkins will build the pipeline.

enter image description here

I have my Jenkinsfile configured and also set the web-hook in my GitHub project, but I don't know if what I want to do can be done or if I'm missing a plugin or configuration. In addition, Jenkins is currently running as a Kubernetes pod.


Solution

  • I saw the problem, for the multi-branch pipeline project the source must be GitHub instead of Git. Configure the web-hook with the desired events, build the project manually one time and then do a test push, it should work.