From d2c0c827fe3f9de6b738b8cfd58134748ed4ce18 Mon Sep 17 00:00:00 2001 From: bhanu Date: Fri, 12 Jul 2024 19:26:50 +0530 Subject: [PATCH] added corrected jenkins file with sonar --- Jenkinsfile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index fa99858de..4e51507db 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,9 @@ pipeline { - agent { label 'hello' } + agent { docker { + image 'bhanu3333/test:4' + args '--user root -v /var/run/docker.sock:/var/run/docker.sock' // mount Docker socket to access the host's Docker daemon + } + } stages { stage('Checkout') { steps { @@ -14,9 +18,9 @@ pipeline { sh 'mvn clean package' } } - stage('StaticCode Analysis') { + stage('Static Code Analysis') { environment { - SONAR_URL = "http://20.197.43.119:32768" + SONAR_URL = "https://20.197.43.119:32768" } steps { withCredentials([string(credentialsId: 'sonarqube', variable: 'SONAR_AUTH_TOKEN')]) {