Use the Jenkins - Merge Requests Webhook to Link a Jenkins Job to a Merge Request
You can use the Jenkins - Merge Requests webhook to link a Jenkins job to a merge request. When a commit is pushed to the review branch of the merge request, the webhook sends a notification to Jenkins and triggers a build of the linked job. When the build completes, it sends a notification back to VB Studio. The linked build will approve or reject the merge request, based on the status of the build.
The Jenkins Merge Request is an outgoing as well as an incoming webhook. The Jenkins job and the webhook must use the merge request’s Git repository with parameters to define the branch. The Notification plugin must also be installed on Jenkins.
You need to specify the Jenkins security settings to allow the webhook to connect to Jenkins.
| If ... | Do this: |
|---|---|
| Jenkins allows an anonymous user to trigger a build on Jenkins |
|
| Jenkins allows only authenticated users to trigger a build |
|
|
Anonymous access on Jenkins is disabled or lacks read permissions and you want to trigger the job without an authenticated user's credentials or Jenkins uses a build token root to trigger builds |
|
| Security is completely disabled on Jenkins | Configure the webhook to connect to Jenkins job. No Jenkins configuration is required. |