@Mark_Rekveld Thank you for checking,
Here are the changes I made now, I got a different error, it’s 404. Before the below changes, I don’t have any issues accessing the endpoint manually.
try {
stage('Scan') {
withSonarQubeEnv('SonarQube') {
sh 'sbt scalastyleGenerateConfig'
sh 'sbt scalastyle'
sh 'sbt coverageReport'
sh 'sbt sonar'
}
script {
sleep(20)
def qg = waitForQualityGate(webhookSecretId: 'xxxSREJenkins')
if (qg.status != 'OK') {
error "Pipeline aborted due to quality gate failure: ${qg.status}"
}
}
}
} catch (e) {
echo "Failed on sonarQube - ${e.getMessage()}"
}
finally {
publishHTML([
])
}
Here is the Jenkins console output.
11:52:08 16:52:07.716 INFO - ANALYSIS SUCCESSFUL, you can browse http://10.x.x.x:9000/dashboard/index/compute-engine
11:52:08 16:52:07.721 INFO - Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
11:52:08 16:52:07.721 INFO - More about the report processing at http://10.x.x.x.:9000/api/ce/task?id=AXXXXXXXXXXXXX-2
11:52:08 16:52:07.903 INFO - Task total time: 22.671 s
11:52:08 INFO: ------------------------------------------------------------------------
11:52:08 INFO: EXECUTION SUCCESS
11:52:08 INFO: ------------------------------------------------------------------------
11:52:08 Total time: 41.095s
11:52:08 Final Memory: 31M/979M
11:52:08 INFO: ------------------------------------------------------------------------
[Pipeline] }
[Pipeline] // withSonarQubeEnv
[Pipeline] script
[Pipeline] {
[Pipeline] sleep
11:52:10 Sleeping for 20 sec
[Pipeline] waitForQualityGate
11:52:30 Checking status of SonarQube task ‘AXXXXXXXXXXXXX-2’ on server ‘SonarQube’
[Pipeline] }
[Pipeline] // script
[Pipeline] }
[Pipeline] // stage
[Pipeline] echo
11:52:30 Failed on sonarQube - Error 404 on http://sre-sonar.3300.aws-company.com:9000/api/ce/task?id=AXXXXXXXXXXXXX-2 : {“errors”:[{“msg”:“No activity found for task ‘AXXXXXXXXXXXXX-2’”}]}
In Sonar Qube Last delivery is Never
Please feel free to let me know if anything required from my end.
Thanks
-Raj