diff --git a/Jenkinsfile b/Jenkinsfile index d9ad9d4..c461f86 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,21 +1,29 @@ pipeline { - agent any + agent { label 'sonar'} + // Make sure this is correctly defined + stages { stage('vcs') { steps { - git branch: 'main', - url: 'https://github.com/dummyrepos/SampleWeb.git' + git branch: 'master', + url: 'https://github.com/sivaganesh2312/SampleWebnop.git' } } - stage('build and analysis') { + stage('SonarQube Analysis') { steps { + + + withSonarQubeEnv(credentialsId: 'SONAR_CLOUD', installationName: 'sonarcloud') { + sh 'dotnet sonarscanner begin /k:"sivaganesh2312_SampleWebnop" /o:sivaganesh2312' sh 'dotnet build SampleMVC.sln --no-incremental' sh 'dotnet test SampleMVC.sln' sh 'dotnet publish -c Release StudentsWeb/StudentsWeb.csproj -o published/' - + sh 'dotnet sonarscanner end' + } } - } } } -} \ No newline at end of file + +================================================== +