Skip to content

Commit cdbc8fa

Browse files
committed
NO-JIRA: Attempt to deal with Sonar branch options since they dont pass through to the container cleanly.
1 parent 0f3204a commit cdbc8fa

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

CI.Jenkinsfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@ node ("docker-light") {
1717
bash -c \"apt-get update && \
1818
apt-get install -y git && \
1919
pushd /source && \
20-
/opt/maven-basis/bin/mvn --batch-mode clean install sonar:sonar \
21-
-Dsonar.login=${env.SONAR_AUTH_TOKEN} \
22-
-Dsonar.host.url=${env.SONAR_HOST_URL}\""
20+
MY_SONAR_OPTS=\"-Dsonar.login=${env.SONAR_AUTH_TOKEN} -Dsonar.host.url=${env.SONAR_HOST_URL}\" \
21+
if [[ ! -z ${env.CHANGE_BRANCH} ]]; then
22+
MY_SONAR_OPTS+=-Dsonar.pullrequest.key=${env.CHANGE_ID} -Dsonar.pullrequest.base=${env.CHANGE_TARGET} -Dsonar.pullrequest.branch=${env.CHANGE_BRANCH}
23+
fi \
24+
echo \"Sonar Options are: ${MY_SONAR_OPTS}\" \
25+
/opt/maven-basis/bin/mvn --batch-mode clean install sonar:sonar ${MY_SONAR_OPTS}\""
2326
}
2427
}
2528
slack(true)

0 commit comments

Comments
 (0)