Skip to content

Commit 665b95d

Browse files
author
Artem Eroshenko
committed
Merge branch 'sonar'
2 parents 59e8a13 + 850cab8 commit 665b95d

File tree

1 file changed

+34
-2
lines changed

1 file changed

+34
-2
lines changed

ci/jenkins.groovy

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ def repo = 'seleniumkit/gridrouter'
44
def buildWarJob = mavenJob("${project}_build-war")
55
def e2eTestsJob = job("${project}_e2e-tests")
66
def sonarJob = mavenJob("${project}_sonar")
7+
def sonarIncrJob = mavenJob("${project}_sonar-incr")
78
def deployJob = mavenJob("${project}_deploy")
89

910
def pullRequestJob = multiJob("${project}_pull-reqest_flow")
@@ -76,7 +77,34 @@ sonarJob.with {
7677
}
7778

7879
publishers {
79-
sonar ()
80+
sonar()
81+
}
82+
}
83+
84+
sonarIncrJob.with {
85+
86+
label('maven')
87+
scm {
88+
git {
89+
remote {
90+
github(repo, 'https', 'github.com')
91+
refspec('${GIT_REFSPEC}')
92+
}
93+
branch('${GIT_COMMIT}')
94+
localBranch('master')
95+
}
96+
}
97+
98+
configure {
99+
it / 'publishers' / 'hudson.plugins.sonar.SonarPublisher' {
100+
jdk('(Inherit From Job)')
101+
branch()
102+
language()
103+
jobAdditionalProperties('-Dsonar.analysis.mode=incremental -Dsonar.github.pullRequest=${ghprbPullId} -Dsonar.github.repository=' + repo)
104+
settings(class: 'jenkins.mvn.DefaultSettingsProvider')
105+
globalSettings(class: 'jenkins.mvn.DefaultGlobalSettingsProvider')
106+
usePrivateRepository(false)
107+
}
80108
}
81109
}
82110

@@ -124,6 +152,10 @@ pullRequestJob.with {
124152

125153
steps {
126154
phase('Build war file') {
155+
job(sonarIncrJob.name) {
156+
prop('GIT_REFSPEC', '+refs/pull/*:refs/remotes/origin/pr/*');
157+
prop('GIT_COMMIT', '\${sha1}');
158+
}
127159
job(buildWarJob.name) {
128160
prop('GIT_REFSPEC', '+refs/pull/*:refs/remotes/origin/pr/*');
129161
prop('GIT_COMMIT', '\${sha1}');
@@ -207,7 +239,7 @@ releaseJob.with {
207239
}
208240
}
209241

210-
goals ('clean deploy')
242+
goals('clean deploy')
211243

212244
wrappers {
213245
mavenRelease {

0 commit comments

Comments
 (0)