| ... | @@ -226,7 +226,32 @@ Started SonarQube. |
... | @@ -226,7 +226,32 @@ Started SonarQube. |
|
|

|
|

|
|
|
|
|
|
|
|
|
|
|
|
|
### Step 4:
|
|
### Step 4: SonarScanner for project
|
|
|
|
|
|
|
|
- We can't scan anything yet to SonarQube because we haven't yet installed SonarScanner for project.
|
|
|
|
- Because the example project that we downloaded earlier is written in javascript we will just point focus on [SonarScanner](https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner#AnalyzingwithSonarQubeScanner-Installation)
|
|
|
|
- Analyzes will be done on Runner and the Runner is running on Windows 10 then we need to download it for 64-bit Windows. Download link above
|
|
|
|
- Extract .zip file and rename it as sonar-scanner
|
|
|
|
- Then move sonar-scanner to C:\sonar-scanner
|
|
|
|
- Then we set sonar-scanner to environment variables
|
|
|
|
- Open your environment variables window. Click new button in System variables section.
|
|
|
|
- Set a variable name SONAR_SCANNER_HOME and its value should be the unzipped path of sonar-runner zip file.
|
|
|
|
- Example:- variable name:- SONAR_SCANNER_HOME variable value:- C:\sonar-scanner
|
|
|
|
- And then append sonar-runner's bin path %SONAR_SCANNER_HOME%\bin to the environment variables path.
|
|
|
|
- Example:- variable name:- PATH variable value:- %SONAR_SCANNER_HOME%\bin;
|
|
|
|
- Now we can run sonar-scanner.bat without folder structure
|
|
|
|
- We need give right address for scanner so analyzes will go right place
|
|
|
|
- Navigate to C:\sonar-scanner\conf\ and edit file sonar-scanner.properties
|
|
|
|
- Edit this one line with right ip-address, it is your virtual machine's ip-address
|
|
|
|
|
|
|
|
```shell
|
|
|
|
#----- Default SonarQube server
|
|
|
|
sonar.host.url=<virtual machine's ip-adress>:9000
|
|
|
|
```
|
|
|
|
|
|
|
|
- Now SonarScanner is ready to use but we still need to do few steps
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| ... | |
... | |
| ... | | ... | |