-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJenkinsfile
More file actions
63 lines (57 loc) · 2.29 KB
/
Jenkinsfile
File metadata and controls
63 lines (57 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
pipeline {
agent any
tools {
maven "3.9.9"
jdk "openjdk-23.0.2"
}
environment {
BASE_VERSION = "ALPHA-2.0"
REVISION = "${BASE_VERSION}.${BUILD_NUMBER}"
}
options {
disableConcurrentBuilds()
}
stages {
stage('Analysis') {
steps {
script {
sh "mvn --batch-mode -V -U -e checkstyle:checkstyle pmd:pmd pmd:cpd spotbugs:spotbugs"
def checkstyle = scanForIssues tool: checkStyle(pattern: '**/target/checkstyle-result.xml')
publishIssues issues: [checkstyle]
def pmd = scanForIssues tool: pmdParser(pattern: '**/target/pmd.xml')
publishIssues issues: [pmd]
def cpd = scanForIssues tool: cpd(pattern: '**/target/cpd.xml')
publishIssues issues: [cpd]
def spotbugs = scanForIssues tool: spotBugs(pattern: '**/target/spotbugsXml.xml')
publishIssues issues: [spotbugs]
def maven = scanForIssues tool: mavenConsole()
publishIssues issues: [maven]
publishIssues id: 'analysis', name: 'All Issues',
issues: [checkstyle, pmd, spotbugs],
filters: [includePackage('io.jenkins.plugins.analysis.*')]
}
}
}
stage('Build') {
steps {
sh 'mvn clean package -B -Drevision=${REVISION}'
}
}
}
post {
always {
archiveArtifacts artifacts: 'target/CreativeManager2*.jar', fingerprint: true
withCredentials([string(credentialsId: 'DISCORD_URL_CREATIVEMANAGER', variable: 'DISCORD_URL')]) {
discordSend webhookURL: DISCORD_URL,
title: "$JOB_NAME #$BUILD_NUMBER",
thumbnail: "https://i.imgur.com/wMJWATd.png",
description: "CI Automated in Jenkins",
footer: "by K0bus",
successful: true,
link: env.BUILD_URL,
showChangeset: true,
result: currentBuild.currentResult
}
}
}
}