Skip to content

Commit

Permalink
Bring back sonar build to jenkins file
Browse files Browse the repository at this point in the history
  • Loading branch information
azoitl committed Dec 13, 2023
1 parent ac03e35 commit 8e2fd0f
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,27 @@ pipeline {
maven 'apache-maven-latest'
jdk 'openjdk-jdk17-latest'
}
environment {
SONARCLOUD_TOKEN = credentials('SonarCloud token for gef')
}
stages {

stage('Build') {
steps {
wrap([$class: 'Xvnc', takeScreenshot: false, useXauthority: true]) {
sh '''
export GDK_BACKEND=x11
mvn clean verify -Dmaven.repo.local=$WORKSPACE/.m2/repository \
-DapiBaselineTargetDirectory=${WORKSPACE} \
-Dgpg.passphrase="${KEYRING_PASSPHRASE}" \
-Dproject.build.sourceEncoding=UTF-8 \
-Peclipse-sign
'''
withCredentials([string(credentialsId: 'sonarcloud-token', variable: 'SonarCloud token for gef')]) {
withSonarQubeEnv(credentialsId: 'sonarcloud-token', installationName: 'GEF Classic') {
wrap([$class: 'Xvnc', takeScreenshot: false, useXauthority: true]) {
sh '''
export GDK_BACKEND=x11
mvn clean verify -Dmaven.repo.local=$WORKSPACE/.m2/repository \
-DapiBaselineTargetDirectory=${WORKSPACE} \
-Dgpg.passphrase="${KEYRING_PASSPHRASE}" \
-Dproject.build.sourceEncoding=UTF-8 \
-Peclipse-sign \
-B sonar:sonar -Dsonar.projectKey=gef-classic -Dsonar.organization=eclipse -Dsonar.host.url=${SONAR_HOST_URL} -Dsonar.login=${SONARCLOUD_TOKEN}
'''
}
}
}
}
post {
Expand Down

0 comments on commit 8e2fd0f

Please sign in to comment.