-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile-old
60 lines (57 loc) · 2.11 KB
/
Jenkinsfile-old
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
pipeline {
agent any
stages{
stage("Tests and Deployment") {
parallel
{
stage("Runing unit tests") {
steps{
sh "pwd"
sh "ls -latr"
sh "ls -latr spring-jenkins-pipeline"
sh "./mvnw -B clean install -PintegrationTest"
step([$class: 'JUnitResultArchiver', testResults:
'**/target/surefire-reports/TEST-*UnitTest.xml'])
}
}
stage('Integration tests') {
stage("Runing integration tests") {
try {
sh "./mvnw -B clean package -DskipTests=true"
sh "docker-compose -f docker-compose.yml up -d"
} catch(err) {
step([$class: 'JUnitResultArchiver', testResults:
'**/target/surefire-reports/TEST-'
+ '*IntegrationTest.xml'])
throw err
}
step([$class: 'JUnitResultArchiver', testResults:
'**/target/surefire-reports/TEST-'
+ '*IntegrationTest.xml'])
}
}
}
}
stage("Compilation and Analysis") {
parallel
{
stage("Compilation") {
sh "./mvnw clean install -DskipTests"
}
stage('Static Analysis') {
stage("Checkstyle") {
sh "./mvnw checkstyle:checkstyle"
step([$class: 'CheckStylePublisher',
canRunOnFailed: true,
defaultEncoding: '',
healthy: '100',
pattern: '**/target/checkstyle-result.xml',
unHealthy: '90',
useStableBuildAsReference: true
])
}
}
}
}
}
}