Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

Version 1 Current »

Adding new project for analysis.

Login to sonarcloud with Admin privileges. Click on new project.

Select the github repo and the programming language used and select the CI as CircleCI. Then it will give the sample config and token as below, copy the token and add in circleci env variables for the particular project.

Sample sonarcloud config for JS/TS language:

Create a file by name sonar-project.properties in root of the repo and update the below info.

sonar.projectName=
sonar.language=
sonar.sources=.
sonar.typescript.lcov.reportPaths=
sonar.projectKey=
sonar.host.url=https://sonarcloud.io
sonar.organization=
sonar.projectVersion=1.0

Run sonar-scanner command in circleci config file, it will read all details from this file.

Sample sonarcloud config for JAVA language:

Add this step in CircleCI by updating all the required parameters.

 name: sonar
 command: |
    mvn verify -Dlog4j.configuration=./logs sonar:sonar -Dsonar.projectKey=project-sunbird_sunbird-data-pipeline -Dsonar.organization=project-sunbird -Dsonar.host.url=https://sonarcloud.io -Dsonar.coverage.jacoco.xmlReportPaths=/home/circleci/dp/data-pipeline/assessment-aggregator/target/coverage-reports/jacoco-ut/jacoco.xml

  • No labels