Skip to content

bcreddydevops/sonarqube

Repository files navigation

Deploy spring-boot-hello to sonarqube

Pre-requisites:

- Install Java
- Install Git
- Install Maven
- Install Jenkins
- Install sonarqube
- Install sonar-scanner

Install Java:

yum install java-1.8.0-openjdk-devel -y

Install Git:

yum install git -y

Install Apache-Maven:

wget https://mirrors.estointernet.in/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
tar xvzf apache-maven-3.6.3-bin.tar.gz

vi /etc/profile.d/maven.sh
--------------------------------------------
export MAVEN_HOME=/opt/apache-maven-3.6.3
export PATH=$PATH:$MAVEN_HOME/bin
--------------------------------------------

source /etc/profile.d/maven.sh
mvn -version

Install Jenkins

sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins.io/redhat-stable/jenkins.repo
sudo rpm --import http://pkg.jenkins.io/redhat-stable/jenkins.io.key
sudo yum install jenkins -y
service jenkins start

Sonarqube installation

Sonarqube installaton

Instll sonar-scanner

 cd /opt
 wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.4.0.2170-linux.zip
 unzip sonar-scanner-cli-4.4.0.2170-linux.zip
 cd sonar-scanner-4.4.0.2170-linux/conf/sonar-scanner.properties

image Give sonaeqube url inside of "sonar-scanner.properties" file

Integrate Sonarqube with jenkins

  1. Add sonarqube plugin

  2. Add SonarQube servers with in jenkins

    • Need to create authentication token with in Sonarqube server

      image

    • Need to create webhook with in Sonarqube server (use Jenkins server URL)

    image

    Click on My Account

    image

    Fill details and click on create

    image

    select security and give some name for token and then click on Generate

  3. Add SonarQube servers details with in "configure system"

image

Name: sonar-scanner Server URL: http://54.210.37.165:9000/ Server authentication token: (Create secret text with authentication token)

  1. Add SonarQube Scanner with in "Global Tool Configuration"

image

Create new pipeline job with jenkinsfile content and build

image

Click on "SonarQube" and check details

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors