Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple GitHub Checks with Jenkins Multibranch pipeline

Tags:

github

jenkins

I have configured Jenkins using Blue ocean multibranch pipeline and a Jenkinsfile to trigger a build when new pull request appear in a repo.

In this pipeline I have two stages that run in parallel, because they are independent tests. What I would like to achieve is to display two check results on the pull request page on Github, one for each stage.

Initially I though about creating two pipelines using two different Jenkinsfile, but it seems that multibranch plugin does not support this.

What is the correct solution to achieve this?

like image 818
Simone Gaiarin Avatar asked Dec 02 '18 16:12

Simone Gaiarin


People also ask

How does Jenkins use Multibranch pipeline?

Head over to your Jenkins instance and create a new item. Enter a name for the job, and select the “Multibranch Pipeline” option at the end of the screen. Then, click on the OK button. In the next screen, go to the “Branch sources” tab, click on the “Add source” button, and choose “Git” from the dropdown menu.

What is the difference between pipeline and Multibranch pipeline in Jenkins?

A multibranch pipeline is meant for building multiple branches from a repository and deploy to multiple environments if required. A pipeline job supports both pipeline steps to be added in Jenkins configuration and form SCM. Use pipeline job for adhoc jobs, parameterised job executions and to debug pipeline as code.

How do I create a GitHub branch source Multibranch pipeline in Jenkins?

Type a name for the job, choose the “Multibranch Pipeline,” and click on the blue “OK” button. Scroll down to the “Branch Sources” section and choose “GitHub” in the “Add source” dropdown. Then, copy and paste the repository URL and click on the “Validate” button to confirm that everything is working.

Can we run multiple pipelines in Jenkins?

A Jenkins pipeline can have multiple stages and each stage will be executed by a single agent, all running on a single machine or multiple machines. A pipeline is normally created for a specific branch of source code.


1 Answers

You can use plugin - https://github.com/jenkinsci/github-autostatus-plugin

The plugin can be configured to send commit status for each stage for jobs build from a multibranch project. For example: enter image description here

like image 199
Parvez Kazi Avatar answered Oct 12 '22 23:10

Parvez Kazi