Skip to content

Instantly share code, notes, and snippets.

@TheBigAleski
Last active May 27, 2025 22:39
Show Gist options
  • Save TheBigAleski/7a4c7fafc3db33ba8c2617e70eafa78b to your computer and use it in GitHub Desktop.
Save TheBigAleski/7a4c7fafc3db33ba8c2617e70eafa78b to your computer and use it in GitHub Desktop.
Cloud Shell SQ Analysis

Cloud Shell SQ Analysis

https://medium.com/@index23/start-sonarqube-server-and-run-analyses-locally-with-docker-4550eb7112a3

Start SonarQube

docker run -d --name sonar-test -p 9000:9000 sonarqube

Install SonarScanner for Python

pip install pysonar

Create a project in your SonarQube instance

  • access SQ using the web preview in the upper right corner of Cloud Shell using port 9000
  • log in with admin/admin
  • create your-project
  • choose to analyze it locally
  • create a token
  • copy analysis command

Run analysis with copied command but using pysonar and http://localhost:9000 as below (http and not https !)

pysonar \
  -Dsonar.projectKey=your-project \
  -Dsonar.sources=. \
  -Dsonar.host.url=http://localhost:9000 \
  -Dsonar.token=sqp_490d030474e902ce73291484445409379d4be26c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment