The plugin of Drone CI to integrate with SonarQube (previously called Sonar), which is an open source code quality management platform.
Detail tutorials: DOCS.md.
build go binary file:
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o drone-sonar
build docker image
docker build -t aosapps/drone-sonar-plugin .
docker run --rm \
-e DRONE_REPO=test \
-e PLUGIN_SOURCES=. \
-e SONAR_HOST=http://localhost:9000 \
-e SONAR_TOKEN=60878847cea1a31d817f0deee3daa7868c431433 \
aosapps/drone-sonar-plugin
code-analysis:
image: aosapps/drone-sonar-plugin
secrets: [sonar_host, sonar_token]