-
Notifications
You must be signed in to change notification settings - Fork 11
/
Jenkinsfile
91 lines (87 loc) · 2.87 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
#!/usr/bin/env groovy
pipeline {
agent {
label 'wollmux'
}
options {
disableConcurrentBuilds()
}
tools {
jdk 'Java11'
}
stages {
stage('Build') {
steps {
withMaven(
maven: 'mvn',
mavenLocalRepo: '.repo',
mavenSettingsConfig: 'org.jenkinsci.plugins.configfiles.maven.MavenSettingsConfig1441715654272',
publisherStrategy: 'EXPLICIT') {
sh "mvn -DdryRun clean package"
}
}
}
stage('Quality Gate') {
steps {
script {
if (GIT_BRANCH == 'main') {
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_UNOHelper \
-Dsonar.host.url=$SONAR_HOST_URL \
-Dsonar.java.source=11 \
-Dsonar.java.target=11 \
-Dsonar.branch.name=${GIT_BRANCH}"
}
}
} else {
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_UNOHelper \
-Dsonar.host.url=$SONAR_HOST_URL \
-Dsonar.java.source=11 \
-Dsonar.java.target=11 \
-Dsonar.branch.name=${GIT_BRANCH} \
-Dsonar.branch.target=${env.CHANGE_TARGET}"
}
}
}
}
}
}
stage('Artifactory Deploy') {
when {
branch "main"
expression { false }
}
steps {
withMaven(
maven: 'mvn',
mavenLocalRepo: '.repo',
mavenSettingsConfig: 'org.jenkinsci.plugins.configfiles.maven.MavenSettingsConfig1441715654272',
publisherStrategy: 'EXPLICIT') {
script {
def server = Artifactory.server('-122848432@1441782548261')
def rtMaven = Artifactory.newMavenBuild()
rtMaven.resolver server: server, releaseRepo: 'libs-release', snapshotRepo: 'libs-snapshot'
rtMaven.deployer server: server, releaseRepo: 'libs-release-local', snapshotRepo: 'libs-snapshot-local'
def buildInfo = rtMaven.run pom: 'pom.xml', goals: 'install'
server.publishBuildInfo buildInfo
}
}
}
}
}
}