I’m using SonarQube 7.6 developer edition and build process gradle using. In Jenkinsfile created Sonarqube analysis stage and ran
“gradlew sonarqube” command.
When I see the log files the sonarqube stage is runing on Jenkins master instead of Jenkins slave node.
Can some one help me on this. Is the sonarqube anaysis will run on Jenkins master only or Do I need to add any steps.
Thanks in advance.
Can Anyone help me on this Please.
In this file you described where SonarScanner for Gradle is executed. If you need to execute it on slave, then you have to configure it.
Read how to configure agent here:
Hi Adam,
I have already configured the agent but looks like SonarQube is not running on Slave node. It is running on Jenkins master
Please paste your Jenkinsfile
.
pipeline{
agent{
label “$slaveNode”
}
stages{
stage('Source Checkout') {
steps{
cleanWs()
}
}
stage('Build'){
script
}//End stage
stage('Test'){
parallel{
stage('Jacoco') {
}//End stage - Jacoco
stage('PIT') {
steps {
}//End stage - PIT
}//End parallel
}//End stage - Test
stage('SonarQube') {
steps {
bat "gradlew.bat -Dsonar.branch.name=$branch sonarqube"
}
}//End stage - SonarQube
}
Are any of your stages is executed on slave node?
All the remaining stages are executing slave node except sonarqube stage.
Are you able to create a Jenkinsfile which allows reproducing the error? For now I have now idea where is the problem.
I didn’t get error means. The sonarqube stage with developer edition is showing java heap size error. For that I passed the parameter in sonarqube stage itself as -Dorg.jvmargs=Xmx2048m
stage(‘SonarQube’) {
steps {
bat "gradlew.bat -Dsonar.branch.name=$branch -Dorg.gradle.jvmargs=-Xmx2048m sonarqube
}
}//End stage - SonarQube
Is that correct way or Can you please suggest me.
The problem which you described in the first post is:
Analysis runs on Jenkins master, not slave node […] Is the sonarqube anaysis will run on Jenkins master only or Do I need to add any steps.
I understood that your SonarQube stage is executed on incorrect node. Now you’ve described a completely different problem:
I don’t see any logs, server configuration etc. Without well described problem and necessary data, nobody will be able to help you.