SiteBackend/Jenkinsfile
Teriuihi 47f6eebd8b Add branch condition to Discord notification stage
The Discord notification stage now runs only on 'main' or 'master' branches. This helps to avoid unnecessary notifications for feature or bugfix branches.
2024-08-11 18:10:36 +02:00

26 lines
744 B
Groovy

pipeline {
agent any
stages {
stage('Gradle') {
steps {
sh 'bash gradlew build -DdoNotRunDatabaseTests=true'
}
}
stage('Archive') {
steps {
archiveArtifacts artifacts: 'build/libs/', followSymlinks: false
}
}
stage('discord') {
when {
anyOf {
branch 'main'
branch 'master'
}
}
steps {
discordSend description: "Build: ${BUILD_NUMBER}", showChangeset: true, result: currentBuild.currentResult, title: currentBuild.fullProjectName, webhookURL: env.discordwebhook
}
}
}
}