-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathJenkinsfile
95 lines (87 loc) · 2.83 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
90
91
92
93
94
95
#!/usr/bin/env groovy
pipeline {
agent {
label 'wollmux'
}
options {
disableConcurrentBuilds()
}
tools {
jdk 'Java17'
}
environment {
UNO_PATH = '/opt/libreoffice24.2/program/'
}
stages {
stage('Build') {
steps {
withMaven(
maven: 'mvn',
mavenLocalRepo: '.repo',
mavenSettingsConfig: 'org.jenkinsci.plugins.configfiles.maven.MavenSettingsConfig1441715654272',
publisherStrategy: 'EXPLICIT') {
sh "mvn -DskipTests -DdryRun clean package"
}
}
}
stage('Junit') {
steps {
withMaven(
maven: 'mvn',
mavenLocalRepo: '.repo',
mavenSettingsConfig: 'org.jenkinsci.plugins.configfiles.maven.MavenSettingsConfig1441715654272',
publisherStrategy: 'EXPLICIT') {
sh "mvn -Dmaven.javadoc.skip=true -DdryRun test verify"
}
}
}
stage('Quality Gate') {
steps {
script {
if (GIT_BRANCH == 'main' || GIT_BRANCH ==~ 'WollMux_[0-9]*.[0-9]*') {
withMaven(
maven: 'mvn',
mavenLocalRepo: '.repo',
mavenSettingsConfig: 'org.jenkinsci.plugins.configfiles.maven.MavenSettingsConfig1441715654272',
publisherStrategy: 'EXPLICIT') {
withSonarQubeEnv('sonarcloud') {
sh "mvn $SONAR_MAVEN_GOAL \
-Dsonar.organization=libreoffice-sonarcloud \
-Dsonar.projectKey=LibreOffice_WollMux \
-Dsonar.branch.name=${GIT_BRANCH} \
-Dsonar.java.source=11 \
-Dsonar.java.target=11 \
-Dsonar.coverage.jacoco.xmlReportPaths=target/site/jacoco/jacoco.xml \
-Dsonar.junit.reportPaths=target/surefire-reports,target/failsafe-reports"
}
}
} else {
archiveArtifacts artifacts: 'oxt/target/LOTS.oxt'
withMaven(
maven: 'mvn',
mavenLocalRepo: '.repo',
mavenSettingsConfig: 'org.jenkinsci.plugins.configfiles.maven.MavenSettingsConfig1441715654272',
publisherStrategy: 'EXPLICIT') {
withSonarQubeEnv('sonarcloud') {
sh "mvn $SONAR_MAVEN_GOAL \
-Dsonar.organization=libreoffice-sonarcloud \
-Dsonar.projectKey=LibreOffice_WollMux \
-Dsonar.branch.name=${GIT_BRANCH} \
-Dsonar.branch.target=${env.CHANGE_TARGET} \
-Dsonar.java.source=11 \
-Dsonar.java.target=11 \
-Dsonar.coverage.jacoco.xmlReportPaths=**/target/site/jacoco/jacoco.xml \
-Dsonar.junit.reportPaths=target/surefire-reports,target/failsafe-reports"
}
}
}
}
}
}
}
post {
cleanup {
cleanWs()
}
}
}