Discord - BredaUniversityGames/JenkinsLib GitHub Wiki
Sends build status notifications, test reports, and review notifications to a Discord channel via webhooks.
stages {
perforce.sync()
ue5.build()
ue5.test()
steam.deploy()
discord.alert()
}- A Discord server with a webhook configured
| Parameter | Default | Description |
|---|---|---|
DISCORD_WEBHOOK |
(empty) | Discord webhook URL |
- Open your Discord server
- Go to Server Settings > Integrations > Webhooks
- Click New Webhook
- Choose the channel where notifications should appear
- Copy the webhook URL
Paste the URL as the DISCORD_WEBHOOK parameter in Jenkins.
Security note: The webhook URL is stored as a plain Jenkins parameter, not a credential. Anyone with access to the job's parameters can see it. If this is a concern, store it as a
Secret textcredential and modify the notification module to usewithCredentials.
Notifications run in the finally block of the pipeline — they always execute, even if the build fails.
Sends an embed with:
- Build result (SUCCESS, FAILURE, UNSTABLE, ABORTED) with color coding
- Build configuration and platform
- VCS revision
- Link to the Jenkins build
If ue5.test() or vs.test() ran, sends a test summary:
- Succeeded / failed / warning counts
- Link to the Jenkins test report
If swarm.review() ran, sends a review notification:
- Link to the Swarm review
- Review author
- Participants
Available on the discord object for custom notifications:
| Method | Description |
|---|---|
discord.send(buildInfo, webhook) |
Send build status notification |
discord.sendTestReport(reportInfo, webhook) |
Send test report |
discord.sendReviewNotification(reviewInfo, webhook) |
Send review notification |
discord.sendCustom(title, color, fields, webhook) |
Send a custom embed |
discord.createGroup(...) |
Create a group for mentions |
discord.mentionGroup(name, groups) |
Format a Discord mention |
discord.mentionGroups(names, groups) |
Format multiple mentions |
See Architecture - Groups System for the JSON groups format used with Discord mentions.