aboutsummaryrefslogtreecommitdiff
path: root/Jenkinsfile
diff options
context:
space:
mode:
authorLexManos <LexManos@gmail.com>2020-10-03 13:56:54 -0700
committerLexManos <LexManos@gmail.com>2020-10-03 13:56:54 -0700
commit5725530e7e8b379d506ca737e9ddd0f00c7f1e32 (patch)
tree834a78a2bf301e5b2c6bccbd451cc27856d4676e /Jenkinsfile
parent977462b1780785a4ce9500646df07b6a4f638461 (diff)
downloadArtifactural-5725530e7e8b379d506ca737e9ddd0f00c7f1e32.tar.gz
Artifactural-5725530e7e8b379d506ca737e9ddd0f00c7f1e32.tar.bz2
Artifactural-5725530e7e8b379d506ca737e9ddd0f00c7f1e32.zip
Fix jenkinsfile.
Diffstat (limited to 'Jenkinsfile')
-rw-r--r--Jenkinsfile35
1 files changed, 30 insertions, 5 deletions
diff --git a/Jenkinsfile b/Jenkinsfile
index ffbcee9..0729868 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -3,18 +3,32 @@
pipeline {
agent {
docker {
- image 'gradlewrapper:latest'
+ image 'gradlewrapper:j10'
args '-v gradlecache:/gradlecache'
}
}
environment {
- GRADLE_ARGS = '-Dorg.gradle.daemon.idletimeout=5000'
+ GRADLE_ARGS = '-Dorg.gradle.daemon.idletimeout=5000 --console=plain'
+ DISCORD_WEBHOOK = credentials('forge-discord-jenkins-webhook')
+ DISCORD_PREFIX = "Job: Artifactural Branch: ${BRANCH_NAME} Build: #${BUILD_NUMBER}"
+ JENKINS_HEAD = 'https://wiki.jenkins-ci.org/download/attachments/2916393/headshot.png'
}
stages {
- stage('fetch') {
+ stage('notify_start') {
+ when {
+ not {
+ changeRequest()
+ }
+ }
steps {
- checkout scm
+ discordSend(
+ title: "${DISCORD_PREFIX} Started",
+ successful: true,
+ result: 'ABORTED', //White border
+ thumbnail: JENKINS_HEAD,
+ webhookURL: DISCORD_WEBHOOK
+ )
}
}
stage('buildandtest') {
@@ -50,7 +64,18 @@ pipeline {
}
post {
always {
- archiveArtifacts artifacts: 'build/libs/**/*.jar', fingerprint: true
+ script {
+ if (env.CHANGE_ID == null) { // This is unset for non-PRs
+ discordSend(
+ title: "${DISCORD_PREFIX} Finished ${currentBuild.currentResult}",
+ description: '```\n' + getChanges(currentBuild) + '\n```',
+ successful: currentBuild.resultIsBetterOrEqualTo("SUCCESS"),
+ result: currentBuild.currentResult,
+ thumbnail: JENKINS_HEAD,
+ webhookURL: DISCORD_WEBHOOK
+ )
+ }
+ }
}
}
} \ No newline at end of file