Introduce a Jenkinsfile to automate the build process using Gradle. The pipeline consists of three stages: building with Gradle, archiving artifacts, and sending build notifications to Discord. This integration enhances the CI/CD workflow by ensuring consistent builds and timely notifications.
20 lines
570 B
Groovy
20 lines
570 B
Groovy
pipeline {
|
|
agent any
|
|
stages {
|
|
stage('Gradle') {
|
|
steps {
|
|
sh 'bash gradlew build'
|
|
}
|
|
}
|
|
stage('Archive') {
|
|
steps {
|
|
archiveArtifacts artifacts: 'build/libs/', followSymlinks: false
|
|
}
|
|
}
|
|
stage('discord') {
|
|
steps {
|
|
discordSend description: "Build: ${BUILD_NUMBER}", showChangeset: true, result: currentBuild.currentResult, title: currentBuild.fullProjectName, webhookURL: env.discordwebhook
|
|
}
|
|
}
|
|
}
|
|
} |