From 35a049e76a1c9ba078e50d57977f3d360cfc5ed7 Mon Sep 17 00:00:00 2001 From: Daniel Kasmeroglu Date: Thu, 22 Aug 2024 16:03:14 +0200 Subject: [PATCH] ~ experimental: jenkins pipeline for home server #8 --- Jenkinsfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e37d83a..35edac4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,8 +3,9 @@ pipeline { tools { nodejs 'node-18.18.2' } - // environment { - // } + environment { + SONAR_KEY = credentials('sonar-key') + } stages { stage('Initialize') { steps { @@ -35,8 +36,8 @@ pipeline { steps { // properties such as sonar.host.url and sonar.login are configured in the m2 settings.xml for this profile // sh 'mvn clean verify -Psonar -Dsonar.projectKey=kcl' - withSonarQubeEnv('sonarqube', credentialsId: 'sonar-key') { - sh "./node_modules/sonar-scanner/bin/sonar-scanner" + withSonarQubeEnv('sonarqube') { + sh "./node_modules/sonar-scanner/bin/sonar-scanner -Dsonar.login=${SONAR_KEY}" } } }