-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
57 lines (52 loc) · 1.61 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
pipeline {
agent any
stages {
stage("Build") {
steps {
sh "./mvnw package" // Runs the Maven package command to build the project
}
}
stage("Run Tests") {
parallel {
stage("Tests A") {
steps {
sh "echo test set A"
sleep 2
sleep 3
}
}
stage("Tests B") {
steps {
sh "echo test set B"
sleep 4
}
}
stage("Tests C") {
steps {
sleep 1
// Uncomment below line to fail this stage intentionally
// sh "false"
}
}
}
failFast true
}
stage("Capture") {
steps {
archiveArtifacts artifacts: '**/target/*.jar'
jacoco() // Generates code coverage reports using JaCoCo
junit keepProperties: true, keepTestNames: true, testResults: '**/target/surefire-reports/TEST*.xml'
}
}
}
post {
always {
emailext(
body: "${env.BUILD_URL}\n${currentBuild.absoluteUrl}",
to: 'always@foo.bar',
recipientProviders: [[$class: 'DevelopersRecipientProvider']],
subject: "${currentBuild.currentResult}: Job ${env.JOB_NAME} [${env.BUILD_NUMBER}]"
)
}
}
}