-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathJenkinsfile
89 lines (89 loc) · 2.71 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
89
pipeline {
agent any
environment {
GITHUB_CREDS = credentials('GITHUB_CRED')
MAVEN_OPTS="-Djava.security.egd=file:/dev/./urandom"
CODECOV_TOKEN = credentials('ARKANE_CODECOV_TOKEN');
}
tools {
jdk "JDK 17"
maven 'apache-maven'
}
options {
disableConcurrentBuilds()
timeout(time: 15, unit: 'MINUTES')
}
stages {
stage('Build') {
when {
not {
anyOf {
branch 'develop'
branch 'master'
branch 'hotfix-*'
branch 'release-*'
}
}
}
steps {
sh 'mvn -v'
sh 'mvn -B -U clean verify'
}
post {
always {
junit '**/target/surefire-reports/*.xml'
jacoco(
execPattern: '**/target/*.exec',
classPattern: '**/target/classes',
sourcePattern: '**/src/main/java',
exclusionPattern: '**/src/test*'
)
}
}
}
stage('Build + Deploy to Nexus') {
when {
anyOf {
branch 'develop'
branch 'master'
branch 'hotfix-*'
branch 'release-*'
}
}
steps {
sh 'mvn -B -U clean deploy'
}
post {
always {
junit '**/target/surefire-reports/*.xml'
jacoco(
execPattern: '**/target/*.exec',
classPattern: '**/target/classes',
sourcePattern: '**/src/main/java',
exclusionPattern: '**/src/test*'
)
}
}
}
stage('Record Coverage') {
when { branch 'develop' }
steps {
script {
currentBuild.result = 'SUCCESS'
}
step([$class: 'MasterCoverageAction', scmVars: [GIT_URL: env.GIT_URL]])
}
}
/*
stage('PR Coverage to Github') {
when { allOf {not { branch 'master' }; expression { return env.CHANGE_ID != null }} }
steps {
script {
currentBuild.result = 'SUCCESS'
}
step([$class: 'CompareCoverageAction', publishResultAs: 'statusCheck', scmVars: [GIT_URL: env.GIT_URL]])
}
}
*/
}
}