3
0
Fork 0
This repository has been archived on 2024-11-14. You can view files and clone it, but cannot push or open issues or pull requests.
ThemePark/Jenkinsfile

43 lines
1.3 KiB
Text
Raw Normal View History

2023-03-13 19:34:15 +00:00
def projectTitle = "ThemePark"
pipeline {
agent any
tools {
maven "maven-3.9.0"
jdk "jdk11-adoptium"
}
stages {
stage('Build Artifact') {
steps {
sh "mvn clean package -Dnoobfus=true"
archiveArtifacts artifacts: 'target/*.jar'
}
}
}
post {
always {
script {
def discordFooter = "Copyright © SBDevelopment"
def buildNumber = currentBuild.number
def buildStatus = currentBuild.result
def prevBuild = currentBuild.getPreviousBuild()
def prevGitRev = prevBuild ? env.GIT_PREVIOUS_COMMIT : ''
def gitRange = prevGitRev ? "${prevGitRev}..HEAD" : "HEAD~1..HEAD"
def gitChanges = sh(returnStdout: true, script: "git log --pretty=format:\"- %h %s\" ${gitRange}")
def discordTitle = "Build #${buildNumber} - ${projectTitle}"
def discordDescription = "**Status:** ${buildStatus}\n**Changes:**\n${gitChanges}"
discordSend(
2023-03-31 15:06:23 +00:00
webhookURL: 'https://discord.com/api/webhooks/1091375346064035980/PRy-w2ZPpYjwYMllnbw6mHD_onFcXSbvq9BYkfP8-mBXi-bB-y1XzJkC4SDwHmffcnjS',
2023-03-13 19:34:15 +00:00
title: discordTitle,
description: discordDescription,
footer: discordFooter,
result: currentBuild.currentResult
)
}
}
}
}