diff options
author | Krzysztof Kuzmicki <krzysztof.kuzmicki@nokia.com> | 2020-04-22 10:43:52 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-04-22 10:43:52 +0000 |
commit | 25764e61bcaf1b464dbed0898b34cb473db8ceda (patch) | |
tree | 87f29c4175bbff43379e4cd366f65ea8c14b25f5 /README_SONAR.md | |
parent | 6e6db5b854d8b531c87260e89a96775a26c672ad (diff) | |
parent | 73c8eec617cc81cac71c9d1670722a003c0ed86f (diff) |
Merge "Add SonarQube local starter"
Diffstat (limited to 'README_SONAR.md')
-rw-r--r-- | README_SONAR.md | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/README_SONAR.md b/README_SONAR.md new file mode 100644 index 0000000..e65b7e6 --- /dev/null +++ b/README_SONAR.md @@ -0,0 +1,73 @@ +# Run SonarQube locally +All instructions based at an article at https://www.vogella.com/tutorials/SonarQube/article.html + +## Configure and run SonarQube locally +* Create and run SonarQube container + ``` + make create-sonarqube + ``` +* Configure SonarQube + + a). Log in at http://localhost:9000 + + ![alt text](docs/sonarqube/login_sonarqube.png "Log in") + + Username: admin + Password: admin + + b). Create a new Sonar project. + + ![alt text](docs/sonarqube/create_new_project_sonarqube.png "Create a new project") + + - Set project name + + ![alt text](docs/sonarqube/create_new_project_step1_sonarqube.png "Set project name") + + - Generate token + + ![alt text](docs/sonarqube/create_new_project_step2_sonarqube.png "Generate token") + + You should see + + ![alt text](docs/sonarqube/create_new_project_step3_sonarqube.png "Generated token") + + - Select code language and building technology + + ![alt text](docs/sonarqube/create_new_project_step4_sonarqube.png "Select code language") + + c). Run code analyse using command from a previous step. + + Before code analyse ALWAYS execute: + + ``` + mvn clean test + ``` + + Next (from previous step): + ``` + mvn sonar:sonar \ + -Dsonar.projectKey=pnf-simulator \ + -Dsonar.host.url=http://localhost:9000 \ + -Dsonar.login=de5dac7da79a4de88876006a05457902aab1a3a3 + ``` + After command execution you should see at the console: + ``` + [INFO] ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/dashboard?id=pnf-simulator + [INFO] Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report + ``` + Click at link http://localhost:9000/dashboard?id=pnf-simulator to see Sonar report + ![alt text](docs/sonarqube/sonarqube_report.png "Select code language") + + IMPORTANT: Please note command used to run code analise. You will need it later. + +## Stopping SonarQube +If you do not want to repeat step **Configure and run SonarQube locally** you must use stopping and starting make goals. +``` + make stop-sonarqube +``` + +## Starting SonarQube +If you do not want to repeat step **Configure and run SonarQube locally** you must use stopping and starting make goals. +``` + make start-sonarqube +``` |