8. Service Discovery
Activity 8.01: Utilizing Jenkins and SonarQube
Solution:
- Install SonarQube and run it as a container using the following command:
docker run -d --name sonarqube -p 9000:9000 -p 9092:9092 sonarqube
You should get the container ID as the output:
4346a99b506b1bec8000e429471dabac57e3f565b154ee921284ec685497bfae
- Log in to SonarQube by using
admin/admin
credentials:After the successful login, a screen similar to the following should appear:
- At the top right, click on the user. A drop-down menu will appear. Click on
My Account
: - Scroll down and click on
Generate
underSecurity
to generate a token. You must copy it now because you will not be able to access it later: - In Jenkins, click on
Manage Jenkins
>Plugin Manager
. Search forSonar
in theAvailable
list. Install theSonarQube Scanner
plugin.