CI Insights Setup – Jenkins
Enable Mergify CI Insights and configure flaky test detection using Jenkins.
Enabling CI Insights for Jenkins
Section titled Enabling CI Insights for Jenkins-
Enable CI Insights on your repositories by visiting the GitHub Integration page (docs).
-
Install and configure the Mergify Jenkins plugin:
Installation:
- Go to
Manage Jenkins
→Manage Plugins
- Select the
Available
tab - Search for
Mergify
and select the checkbox next toMergify Plugin
- Install the plugin using one of the install buttons at the bottom
- To verify installation, search for
Mergify Plugin
on theInstalled
tab
Configuration: After installation, you need to add the Mergify CI Insights API Key for each GitHub organization you want to support. Go to
Manage Jenkins
→Configure System
and configure the Mergify plugin with your API keys.Note: It’s highly recommended to set the GitHub project URL for each job if you’re not using the GitHub Branch Source plugin. This ensures proper correlation between Jenkins jobs and GitHub repositories.
- Go to
-
Configure your Jenkins pipeline job with the
MERGIFY_TOKEN
environment variable. First, get your token from the Mergify dashboard by going toSettings
>CI Insights
:Then add the token to Jenkins credentials and configure your pipeline to use it:
pipeline { agent any environment { MERGIFY_TOKEN = credentials('MERGIFY_TOKEN') } ... }
Make sure to store your Mergify token as a Jenkins credential with the ID
MERGIFY_TOKEN
. -
Click on
CI Insights
in the Mergify dashboard navigation. You should start seeing your Jenkins job runs appear: