jenkinsci / discord-notifier-plugin

A post-build plugin that sends the build status to a Discord channel.
https://plugins.jenkins.io/discord-notifier/
MIT License
50 stars 25 forks source link

Send Notification Pipeline Declarative - Help #43

Open padepokan79dev opened 2 years ago

padepokan79dev commented 2 years ago

Can you tell me how to send notification to discord like this at Jenkins Pipeline Jobs?

at this image i'm using freestyle jobs image

Thank's before

richardg867 commented 2 years ago

Seconding this request. I've recently migrated my project from freestyle to pipeline builds, and it appears there is no way to make this plugin send the default freestyle layout on a pipeline.

richardg867 commented 2 years ago

As an update, this discordSend invocation should produce an embed that is pretty similar to the freestyle one, though it needs the latest git master version of this plugin due to the usage of description, enableArtifactsList and showChangeset:

def result = currentBuild.currentResult.toLowerCase()
discordSend webhookURL: DISCORD_WEBHOOK_URL,
            title: "${env.JOB_BASE_NAME} #${env.BUILD_NUMBER}",
            result: currentBuild.currentResult,
            description: "**Build:** ${env.BUILD_NUMBER}\n**Status:** ${result}\n\u2060", /* word joiner character forces a blank line */
            enableArtifactsList: true,
            showChangeset: true
rasperepodvipodvert commented 2 years ago

How can i download hpi plugin from master?

rizqikazukun commented 3 weeks ago

As an update, this discordSend invocation should produce an embed that is pretty similar to the freestyle one, though it needs the latest git master version of this plugin due to the usage of description, enableArtifactsList and showChangeset:

def result = currentBuild.currentResult.toLowerCase()
discordSend webhookURL: DISCORD_WEBHOOK_URL,
            title: "${env.JOB_BASE_NAME} #${env.BUILD_NUMBER}",
            result: currentBuild.currentResult,
            description: "**Build:** ${env.BUILD_NUMBER}\n**Status:** ${result}\n\u2060", /* word joiner character forces a blank line */
            enableArtifactsList: true,
            showChangeset: true

Cool