From fbeb1b31d92d123077529c7d5deb99f1a03efc87 Mon Sep 17 00:00:00 2001 From: Max Nuding Date: Fri, 10 Nov 2023 19:27:55 +0100 Subject: [PATCH] Fix sonar analysis block --- Jenkinsfile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 95dba03..22e0298 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -39,11 +39,13 @@ pipeline { stage('SonarQube Analysis') { steps { withSonarQubeEnv(installationName: 'SQ Bib Watcher', envOnly: true) { - sh """ - printenv - cargo clippy --message-format=json &> clippy-output.json - sonar-scanner -Dsonar.projectKey=bib-watcher -Dsonar.sources=. -Dsonar.host.url=http://grover.local:9000 - """ + withEnv(["PATH+RUST=$HOME/.cargo/bin"]) { + sh """ + SONAR_TOKEN="$SONAR_AUTH_TOKEN" + cargo clippy --message-format=json &> clippy-output.json + sonar-scanner -Dsonar.projectKey=bib-watcher -Dsonar.sources=. -Dsonar.host.url=http://grover.local:9000 + """ + } } } }