I'm trying to set up different build jobs in Jenkins for different branches of a Gitlab repository. I'm using Gitlab web hook to trigger the build.
Here are the steps I followed to setup a web hook for Jenkins CI in Gitlab
- Go to the project
- Settings --> Integrations
- Under 'Project Services', I've selected 'Jenkins CI'
- Now I've checked the 'Active' checkbox
- Jenkins url :
<jenkins url>
- Project Name :
<jobname_on_jenkins>
and provided credentials.
In Jenkins, I've selected the under 'Build triggers', I've selected
"Build when a change is pushed to GitLab" and provided the branch filters.
Now, In Jenkins, I've created another job with branch filter as different branch name.
Now my question is, How do i setup a web hook in Gitlab to trigger a different Jenkins job when there is a change in a specific branch. I tried providing comma separated job names for the field 'Project Name' in Gitlab web hook for Jenkins CI but it's not allowing comma separated values there.
Other details:
Gitlab version : GitLab Enterprise Edition 10.8.7-ee 075705a
Jenkins version: 2.138.3
Plugins installed on Jenkins : Gitlab, Gitlab webhook