Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions SonarQube/Sonar_Integration_with_Jenkins.MD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

## SonarQube Integration with Jenkins

Integration SonarQube server with Jenkins is necessary to store your reports. Follow below steps to enable that.
Integration SonarQube server with Jenkins is necessary to store your reports. Follow the below steps to enable that.
### Follow this in **[YouTube](https://www.youtube.com/watch?v=k-3krTRuAFA)**

### Prerequisites
Expand All @@ -10,7 +10,7 @@ Integration SonarQube server with Jenkins is necessary to store your reports. Fo

### Implementation

Login to Jenkins server and install sonarqube scanner.
Login to Jenkins server and install SonarQube scanner.

- SonarQube scanner URL : https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner
- Package : https://sonarsource.bintray.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-3.2.0.1227-linux.zip
Expand All @@ -26,27 +26,27 @@ Set SonarQube server details in sonar-scanner property file
- Sonar properties file: /opt/sonar_scanner/conf/sonar-scanner.properties
- sonar.host.url=http://`<SONAR_SERVER_IP>`:9000

Login to Jenkins GUI console and install " SonarQube scanner" plugin
Login to Jenkins GUI console and install "SonarQube scanner" plugin

- `Manage Jenkins` > `Manage Plugins` > `Avalable` > `SonarQube scanner`
- `Manage Jenkins` > `Manage Plugins` > `Available` > `SonarQube scanner`

Configure SonarQube scanner home path

- `Manage Jenkins` > `Global Tool Configuration` > `SonarQube Scanner`
- Name : `sonar_scanner`
- SONAR_RUNNER_HOME : `/opt/sonar_scanner`
- Name: `sonar_scanner`
- SONAR_RUNNER_HOME: `/opt/sonar_scanner`

Configure SonarQube server name and authentication token
Configure the SonarQube server name and authentication token
- `Manage Jenkins` > `Configure Systems` > `SonarQube Servers`
- Name : `SonarQube`
- Name: `SonarQube`
- ServerURL : `http://<Sonarqube_server>:9000/sonar`
- Server `authentication token`
To Get Authentication code follow below steps.
Login to SonarQube server as a admin `My Account` > `Security` > `Generate Token`
To Get an Authentication code follow the below steps.
Login to the SonarQube server as an admin `My Account` > `Security` > `Generate Token`

Create a job to test SonarQube. Provide below sonar properties details in the job under build
- Build:
- `Execute SonarQube Scanner` > `Analysis properties` (it is mandatary).
- `Execute SonarQube Scanner` > `Analysis properties` (it is mandatory).
- sonar.projectKey=`Valaxy`
- sonar.projectName=`ValaxyDemo`
- sonar.projectVersion=`1.0`
Expand Down