-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathJenkinsfile
67 lines (64 loc) · 2.11 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
pipeline {
agent any
parameters {
booleanParam(
defaultValue: false,
description: 'Perform Integration Tests',
name: 'INTEGRATION_TESTS')
}
stages {
stage ('Clone') {
steps {
checkout scm
}
}
stage ('Build') {
// without 'tools', javadoc fails with this error
// "Unable to find the 'javadoc' executable. Tried home: /usr/lib/jvm/java-11-openjdk-amd64"
tools {
jdk 'jdk18'
}
steps {
sh 'echo $PATH'
sh 'java -version'
sh './gradlew clean build'
junit 'build/test-results/**/*.xml'
}
}
stage ('Integration Tests') {
when {
// Only run integration tests if requested
expression { params.INTEGRATION_TESTS }
}
steps {
echo "Performing integration tests."
sh './gradlew jacocoIntegTestReport'
publishHTML(target: [
allowMissing: false,
alwaysLinkToLastBuild: true,
keepAll: true,
reportDir: 'build/reports/jacoco/jacocoIntegTestReport',
reportFiles: 'index.html',
reportName: "Jacoco Integ Report"
])
}
}
stage ('Jacoco Report') {
when {
// Only run integration tests if requested
not { expression { params.INTEGRATION_TESTS } }
}
steps {
sh './gradlew jacocoTestReport'
publishHTML(target: [
allowMissing: false,
alwaysLinkToLastBuild: true,
keepAll: true,
reportDir: 'build/reports/jacoco/jacocoTestReport',
reportFiles: 'index.html',
reportName: "Jacoco Report"
])
}
}
}
}