A plugin for Drone CI to run SonarQube analysis on node, JavaScript and TypeScript projects.
The simplest use in a drone pipeline is shown below, you just have to provide secrets for the SonarQube host (sonar-host
) and login token (sonar-token
).
- name: code-analysis
image: committed/drone-sonarqube-node
settings:
host:
from_secret: sonar_host
token:
from_secret: sonar_token
For full parameter details see DOCS.md.
Dependencies are managed with dep
and stored in the vendor directory
To build the go binary file (build.sh
):
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o drone-sonarqube-node
To build the docker image (docker.sh
):
docker build -t committed/drone-sonarqube-node .
Both steps are performed in ./build.sh
To test the docker image run the docker image with appropriate properties:
docker run --rm \
-e DRONE_REPO=test \
-e PLUGIN_SOURCES=. \
-e SONAR_HOST=http://localhost:9000 \
-e SONAR_TOKEN=60878847cea1a31d817f0deee3daa7868c431433 \
committed/drone-sonarqube-node
This is based on the original work by aosapps and the node modified version by anthonyjesmok.