Here's how to set up a Jenkins webhook.
Once configured, you can route Jenkins Notifications to alerts in a Slack channel, create incidents tied to those alerts, and invoke Transposit actions to remediate the incidents.
1. Create Jenkins Notification Webhooks in Transposit#
- On the Transposit site, navigate to Settings gear icon > Webhooks, and click Add webhook. Choose "Jenkins build integrator." All incoming alerts will always appear in the Activity feed. It is optional to also set a Slack channel for the alert to appear in. (Note: The Slack channel must already exist; create it before adding the webhook.) Click Add.
- Find the webhook you just added, and copy the "Endpoint URL."
2. Set Up Webhooks in Jenkins#
2.1 Install the Jenkins Notification Plugin#
- In Jenkins, Navigate to the plugin manager under Manage Jenkins > Manage Plugins, and click on the Available tab.
- Search for "Notification", check the box beside the plugin named "Notification", and then click the Install without restart button to install it.
Note: If you don't see the "Notification" plugin listed, check if it is already listed in the Installed tab.
2.2 Edit Jenkins Job Configuration#
- In Jenkins, navigate to the job you would like to call this webhook, and click Configure in the right menu. Click the Job Notifications tab in the top menu, and then click the Add Endpoint button.
- Set the "Event" select menu to the type of events you would like to receive alerts for, set the "URL" field to the Endpoint URL you copied from Transposit, and click Save.
Jenkins is now setup to call this webhook as defined in the Job Notifications Event select menu.