-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
76 lines (76 loc) · 3.21 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
pipeline {
agent any
stages {
stage('Clean All') {
steps {
sh './gradlew clean'
}
}
stage('Build API') {
environment {
SPRING_REDIS_HOST = 'redis'
}
steps {
sh './gradlew -p api test jacocoTestReport'
junit(testResults: 'api/build/test-results/test/*.xml', allowEmptyResults: true)
sh './gradlew -p api bootJar'
archiveArtifacts 'api/build/libs/*.jar'
sh './gradlew -p api integrationTest jacocoTestReport '
jacoco(changeBuildStatus: false,
execPattern: '**/**.exec',
classPattern: '**/classes',
exclusionPattern: '**/*Test*.class,**/dto/*,**/model/*',
sourcePattern: '**/src/main/kotlin',
minimumLineCoverage: '60',
minimumComplexityCoverage: '45',
minimumMethodCoverage: '50')
publishHTML([
allowMissing : false,
alwaysLinkToLastBuild: false,
keepAll : true,
reportDir : 'api/build/reports/tests/jacoco',
reportFiles : 'index.html',
reportName : 'API Coverage Report'
])
}
}
stage('Publish API Container') {
steps {
sh './gradlew -p api docker dockerTagLatest dockerPush dockerPushLatest'
}
}
stage('Build Frontend') {
environment {
SPRING_REDIS_HOST = 'redis'
}
steps {
sh './gradlew -p frontend test jacocoTestReport'
junit(testResults: 'frontend/build/test-results/test/*.xml', allowEmptyResults: true)
sh './gradlew -p frontend bootJar'
archiveArtifacts 'frontend/build/libs/*.jar'
sh './gradlew -p frontend integrationTest jacocoTestReport '
jacoco(changeBuildStatus: false,
execPattern: '**/**.exec',
classPattern: '**/classes',
exclusionPattern: '**/*Test*.class,**/dto/*,**/model/*',
sourcePattern: '**/src/main/kotlin',
minimumLineCoverage: '60',
minimumComplexityCoverage: '45',
minimumMethodCoverage: '50')
publishHTML([
allowMissing : false,
alwaysLinkToLastBuild: false,
keepAll : true,
reportDir : 'frontend/build/reports/tests/jacoco',
reportFiles : 'index.html',
reportName : 'Frontend Coverage Report'
])
}
}
stage('Publish Frontend Container') {
steps {
sh './gradlew -p frontend docker dockerTagLatest dockerPush dockerPushLatest'
}
}
}
}