Hello Team
I’m using Bitbucket cloud and tried to fetch sonar QG status.
we are using sonarqube hosted on-prem and it is integrated with bitbucket cloud.
Since sonarqube on-prem URL can’t be exposed outside, we created a webseal junction which acts as a proxy and is accessible over internet.
Using different steps for sonar analysis and sonar QG.
Created repository variables for sonar host containing public endpoint and token.
For sonar analysis we run the below maven command:
script:
- mvn -P test_profile sonar:sonar -Dsonar.host.url=$SONAR_HOST_URL -Dsonar.login=$SONAR_TOKEN
for sonar QG we have this:
- pipe: sonarsource/sonarqube-quality-gate:1.1.0
variables:
SONAR_HOST_URL: ${SONAR_HOST_URL}
SONAR_TOKEN: ${SONAR_TOKEN}
REPORT_FILE: target/sonar/report-task.txt
- echo "Sonar QG Stage Completed
We donot have on-prem sonar URL defined anywhere in code or config files but strangely despite providing repo variables it is still taking sonar on-prem URL.
Assumed that sonar QG step takes the URL from generated report-task.txt so modified the url in report-task.txt for debugging to see if that’s successful.
Also validated that repo variable {SONAR_HOST_URL} contains the public endpoint but when analysis is done, it displays analysis successful and points to on-prem endpoint.
And QG step fails connecting to on-prem.
Kindly help in fixing this issue.
Thanks in advance!!