Skip to content

Latest commit

 

History

History
138 lines (132 loc) · 12.6 KB

Sonar-Qube.md

File metadata and controls

138 lines (132 loc) · 12.6 KB

image

image

image

image

image

image

# sonarqube setup - https://github.com/rupeshpanwar/DevOps/blob/master/sonarqube/Setup_SonarQube.md - open port 9000 on sonar node

image

image

image

image

image

image

image

image

image

image

- default cred for login first time admin/admin

image

image

# Overview

image

image

image

image

image

image

image

image

image

image

image

image

- run on maven server to send the code to SQ

image

image

image

image

image

image

image

SQ - Postgres Integration

image

image

- https://github.com/rupeshpanwar/DevOps/blob/master/sonarqube/Sonarqube_with_database.md

image

- SQ node , SG

image

image

image

image

image

image

image

image

image

image

image

## install SQ now

image

image

image

image

image

image

image

image

image

image

image

image

image

SQ - Jenkins Integration

image

image

- to generate a token in Jenkins, add a project

image

image

image

image

image

image

- create a jenkins credentials using token

image

image

- Install SQ Scanner on Jenkins node

image

## create pipeline type for SQ pipeline

image

- take mvn path from Jenkins server

image

``` Jenkinsfile pipeline{ agent any environment { PATH = "$PATH:/opt/apache-maven-3.8.2/bin" } stages{ stage('GetCode'){ steps{ git 'https://github.com/ravdy/javaloginapp.git' } } stage('Build'){ steps{ sh 'mvn clean package' } } stage('SonarQube analysis') { // def scannerHome = tool 'SonarScanner 4.0'; steps{ withSonarQubeEnv('sonarqube-8.9') { // If you have configured more than one global server connection, you can specify its name // sh "${scannerHome}/bin/sonar-scanner" sh "mvn sonar:sonar" } } }
}

}

<img width="862" alt="image" src="https://user-images.githubusercontent.com/75510135/146300250-cf9c3953-2e75-431d-84f5-1a8cae4aa556.png">
<img width="1033" alt="image" src="https://user-images.githubusercontent.com/75510135/146300295-8a053efc-585f-4b07-99fc-8eef71a4d2c8.png">
- set new profile in SQ
<img width="803" alt="image" src="https://user-images.githubusercontent.com/75510135/146300486-cfab2d3f-c2c9-4f38-b19f-c040f294cc51.png">

<img width="893" alt="image" src="https://user-images.githubusercontent.com/75510135/146300543-b1c70862-e4fb-4972-8528-1b995a057796.png">
<img width="994" alt="image" src="https://user-images.githubusercontent.com/75510135/146300579-a7f89b1f-ccb2-4395-8a54-57b496c904fa.png">