-
-
Notifications
You must be signed in to change notification settings - Fork 99
/
Jenkinsfile
88 lines (88 loc) · 2.82 KB
/
Jenkinsfile
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
pipeline {
agent {
label 'openjdk11bot'
}
options {
disableConcurrentBuilds()
}
tools {
maven 'maven-3.9'
jdk 'temurin-jdk17'
}
environment {
MAVEN_OPTS='-Djava.awt.headless=true -Xmx4096m'
}
parameters {
string name: 'REL_VERSION', defaultValue: "3.5.x", description: 'Next release version'
string name: 'DEV_VERSION', defaultValue: "3.5.x-SNAPSHOT", description: 'Next snapshot version'
booleanParam name: 'PERFORM_RELEASE', defaultValue: false, description: 'Perform release build (on main branch only)'
}
stages {
stage ('Initialize') {
steps {
sh '''
echo "PATH = ${PATH}"
echo "M2_HOME = ${M2_HOME}"
'''
sh 'mvn -version'
sh 'java -version'
sh 'git --version'
}
}
stage ('Build') {
steps {
echo 'Building'
sh 'mvn -B -C -P oracle clean test-compile'
}
}
stage ('Test') {
steps {
echo 'Testing'
sh 'mvn -B -C -fae -P integration-tests,oracle install'
}
post {
always {
junit '**/target/*-reports/*.xml'
}
}
}
stage ('Quality Checks') {
when {
branch 'main'
}
steps {
echo 'Quality checking'
sh 'mvn -B -C -fae -P oracle com.github.spotbugs:spotbugs-maven-plugin:spotbugs javadoc:javadoc'
}
post {
always {
recordIssues enabledForFailure: true, tools: [mavenConsole(), java(), javaDoc()]
recordIssues enabledForFailure: true, tool: spotBugs()
}
}
}
stage ('Release') {
when {
allOf {
triggeredBy cause: "UserIdCause", detail: "tmc"
expression { return params.PERFORM_RELEASE }
}
}
steps {
echo 'Prepare release version ${REL_VERSION}'
sh 'mvn -Dresume=false -DreleaseVersion=${REL_VERSION} -DdevelopmentVersion=${DEV_VERSION} -DdeployAtEnd=true -Dgoals=deploy release:prepare release:perform -P integration-tests,oracle,handbook'
}
post {
success {
archiveArtifacts artifacts: '**/target/deegree-webservices-*.war', fingerprint: true
archiveArtifacts artifacts: '**/target/deegree-documentation*.zip', fingerprint: true
}
}
}
}
post {
always {
cleanWs notFailBuild: true
}
}
}