KocproZ / jenkins-discord

A post-build plugin that sends the build status to a Discord channel.
MIT License
39 stars 36 forks source link
discord-webhooks jenkins-discord jenkins-plugin

Read me!

This repo has been moved to jenkinsci organization. Please submit issues/PRs there.

Discord Notifier

Discord Notifier provides a bridge between Jenkins and Discord through the built-in webhook functionality.

The purpose

The Jenkins Discord Webhook plugin was made to share results of a build to a Discord channel using the webhooks that Discord provides.

Through this plugin you are able to:

Download

You'll have to manually install the plugin via the advanced tab of your plugin settings. A Jenkins plugin repo build will be available soon.

Usage

This plugin uses the post-build feature to execute a request.

After installing, go to your job's configure section and add the Discord Notifier item. Then proceed to enter your webhook URL.

Post-build dropdown with Discord Webhooks selected

There are a few options you can choose from:

Standard options in the Discord Webhook config Advanced tab in the config

Pipeline

Discord Notifier supports Jenkins Pipeline. The only required parameter is webhookURL (the URL of the webhook, of course) - but there isn't much point of sending nothing.

Parameters

Example

pipeline {
  agent any

  post {
    always {
      discordSend description: 'Jenkins Pipeline Build', footer: 'Footer Text', link: env.BUILD_URL, result: currentBuild.currentResult, unstable: false, title: JOB_NAME, webhookURL: 'Webhook URL'
    }
  }
}