for the last few days I am trying to set up a webhook in Sonar in terms to obtain the result of the Sonar Analysis in my Jenkins pipeline - however I am not able to do that in any way. The part of the script looks as follow:
I have no idea why you’re seeing “Server Unreachable”. That would point to configuration issues that you’re not showing here.
However, I would point out two things. First, the call to “waitForQualityGate” probably should occur after the “withSonarQubeEnv” block. I don’t know if that’s a critical issue. Second, a 3 minute timeout for the scan and the background task to complete is probably unrealistic.
thank you very much for your response.
What kind of configuration would you check in the first place?
When it comes to your points - they are good, but I have already double checked them.
Anyway I have just started another job with 10 minutes of timeout and I have moved the “withSonarQubeEnv” to one block earlier - but it did not help.
If you’re seeing “Server unreachable” in SonarQube then… Jenkins isn’t receiving the webhook call because SonarQube couldn’t reach it.
When you manually call the Jenkins Webhook URL you’ve configured into SonarQube, do you get a response? Do you have anything on the network (proxy, firewall) between the two that might be interfering?
And… that --cacert part catches my eye. Is it required to make the curl call work? And if so, I guess you need to make the cert available to the JVM running SonarQube…?
To be honest - I am really not sure if I have done it right - I have followed many topics in “google” and in the theory it should work, but I had to miss something.
As mentioned it worked for me using SonarQube 7.6 (within docker). I have not tried SonarQube 7.4 but upgrading to 7.9 did not work anymore (I expected due to the JDK Upgrade) …