How to run sonar scanner on an Ionic 2 project

Viewed 3882

We have migrated our frontend project from ionic/es6/angular to ionic2/typescript/angular2. Everything is good except we don't know how to run sonar report on the project.

Previously we are using gulp and run gulp sonar command to generate the sonar report (on an local sonar server).

We don't use gulp in the new ionic2 project and wonder how to run the sonar scanner on the new project.

Note

  1. we have installed typescript plugin on our sonar server.
  2. we have added sonar-project.properties file in the project rood directory

Question is how to run it

Thanks...

2 Answers

You can download the sonar-scanner tool from sonar and run it in the project folder:

sonar-scanner \
  -Dsonar.projectKey=your-project \
  -Dsonar.organization=your-org \
  -Dsonar.sources=. \
  -Dsonar.host.url=https://sonarcloud.io \
  -Dsonar.login=8ed524debb4f53489e99bd66eb5110a3e8c2958e

Personally, I used my repositories pipelines to do the scan.

Related