From 3fc8561265e6442b2db9f360fe607824cd8402b1 Mon Sep 17 00:00:00 2001 From: Teriuihi Date: Tue, 20 Aug 2024 21:12:13 +0200 Subject: [PATCH] Add Jenkinsfile for CI pipeline Set up a Jenkins pipeline with stages for building using Gradle, archiving artifacts, and sending notifications to Discord. This configuration ensures that builds are processed with Gradle and results are communicated effectively for branches 'main' and 'master'. --- Jenkinsfile | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..93ec928 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,26 @@ +pipeline { + agent any + stages { + stage('Gradle') { + steps { + sh 'bash gradlew build' + } + } + 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 + } + } + } +} \ No newline at end of file