Try it like this
This commit is contained in:
parent
50f3c33d4e
commit
f0f7bc06da
1 changed files with 21 additions and 19 deletions
40
Jenkinsfile
vendored
40
Jenkinsfile
vendored
|
@ -11,7 +11,7 @@ pipeline {
|
|||
stages {
|
||||
stage('Build Artifact') {
|
||||
steps {
|
||||
sh "mvn clean package -Dnoobfus=true"
|
||||
sh "mvn clean package"
|
||||
archiveArtifacts artifacts: 'target/*.jar'
|
||||
}
|
||||
}
|
||||
|
@ -19,25 +19,27 @@ pipeline {
|
|||
|
||||
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}"
|
||||
node {
|
||||
script {
|
||||
def discordFooter = "Copyright © SBDevelopment"
|
||||
def buildNumber = currentBuild.number
|
||||
def buildStatus = currentBuild.result ?: 'SUCCESS'
|
||||
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}").trim()
|
||||
def discordTitle = "Build #${buildNumber} - ${projectTitle}"
|
||||
def discordDescription = "**Status:** ${buildStatus}\n**Changes:**\n${gitChanges}"
|
||||
|
||||
discordSend(
|
||||
webhookURL: 'https://discord.com/api/webhooks/1091375346064035980/PRy-w2ZPpYjwYMllnbw6mHD_onFcXSbvq9BYkfP8-mBXi-bB-y1XzJkC4SDwHmffcnjS',
|
||||
title: discordTitle,
|
||||
description: discordDescription,
|
||||
footer: discordFooter,
|
||||
result: currentBuild.currentResult
|
||||
)
|
||||
discordSend(
|
||||
webhookURL: 'https://discord.com/api/webhooks/1091375346064035980/PRy-w2ZPpYjwYMllnbw6mHD_onFcXSbvq9BYkfP8-mBXi-bB-y1XzJkC4SDwHmffcnjS',
|
||||
title: discordTitle,
|
||||
description: discordDescription,
|
||||
footer: discordFooter,
|
||||
result: currentBuild.currentResult
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue