首先,需要确认 SONAR_HOST_URL 是否正确设置。如果 URL 正确无误,则可以通过检查 Bitbucket pipeline 配置和代码权限等问题来解决。 另外,还可以尝试添加以下 settings 来指定 SonarQube Server 的 URL:
image: node:8.11.3
options:
max-time: 5m
timeout: 5m
pipelines:
default:
- step:
script:
- export SONAR_HOST_URL="http://sonarqube.myorg.com/"
- sonar-scanner
如果仍然存在问题,可以尝试通过检查网络和防火墙设置等问题来解决。