mirror of
https://github.com/GeyserMC/GeyserConnect.git
synced 2025-06-26 14:15:22 +02:00
Add skippable discord notifications to the build
This commit is contained in:
parent
4154993924
commit
9c803c3355
1 changed files with 13 additions and 2 deletions
11
Jenkinsfile
vendored
11
Jenkinsfile
vendored
|
@ -1,12 +1,19 @@
|
||||||
pipeline {
|
pipeline {
|
||||||
agent any
|
agent any
|
||||||
|
|
||||||
tools {
|
tools {
|
||||||
maven 'Maven 3'
|
maven 'Maven 3'
|
||||||
jdk 'Java 8'
|
jdk 'Java 8'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
parameters{
|
||||||
|
booleanParam(defaultValue: false, description: 'Skip Discord notification', name: 'SKIP_DISCORD')
|
||||||
|
}
|
||||||
|
|
||||||
options {
|
options {
|
||||||
buildDiscarder(logRotator(artifactNumToKeepStr: '5'))
|
buildDiscarder(logRotator(artifactNumToKeepStr: '5'))
|
||||||
}
|
}
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
stage ('Build') {
|
stage ('Build') {
|
||||||
steps {
|
steps {
|
||||||
|
@ -84,9 +91,13 @@ pipeline {
|
||||||
env.changes = message
|
env.changes = message
|
||||||
}
|
}
|
||||||
deleteDir()
|
deleteDir()
|
||||||
|
script {
|
||||||
|
if(!params.SKIP_DISCORD) {
|
||||||
withCredentials([string(credentialsId: 'geyser-discord-webhook', variable: 'DISCORD_WEBHOOK')]) {
|
withCredentials([string(credentialsId: 'geyser-discord-webhook', variable: 'DISCORD_WEBHOOK')]) {
|
||||||
discordSend description: "**Build:** [${currentBuild.id}](${env.BUILD_URL})\n**Status:** [${currentBuild.currentResult}](${env.BUILD_URL})\n${changes}\n\n[**Artifacts on Jenkins**](https://ci.nukkitx.com/job/GeyserMC/job/GeyserConnect)", footer: 'Cloudburst Jenkins', link: env.BUILD_URL, successful: currentBuild.resultIsBetterOrEqualTo('SUCCESS'), title: "${env.JOB_NAME} #${currentBuild.id}", webhookURL: DISCORD_WEBHOOK
|
discordSend description: "**Build:** [${currentBuild.id}](${env.BUILD_URL})\n**Status:** [${currentBuild.currentResult}](${env.BUILD_URL})\n${changes}\n\n[**Artifacts on Jenkins**](https://ci.nukkitx.com/job/GeyserMC/job/GeyserConnect)", footer: 'Cloudburst Jenkins', link: env.BUILD_URL, successful: currentBuild.resultIsBetterOrEqualTo('SUCCESS'), title: "${env.JOB_NAME} #${currentBuild.id}", webhookURL: DISCORD_WEBHOOK
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue