0% found this document useful (0 votes)
7 views1 page

Sonarqub Instalation

The document provides a step-by-step guide for configuring a SonarQube server on an EC2 instance, including installing necessary software and setting up user permissions. It also includes a Jenkins pipeline script for scanning code and checking the quality gate. The instructions cover downloading SonarQube, starting the server, and accessing it via a web browser.

Uploaded by

Srikanth
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views1 page

Sonarqub Instalation

The document provides a step-by-step guide for configuring a SonarQube server on an EC2 instance, including installing necessary software and setting up user permissions. It also includes a Jenkins pipeline script for scanning code and checking the quality gate. The instructions cover downloading SonarQube, starting the server, and accessing it via a web browser.

Uploaded by

Srikanth
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

--> Configuring SonarQube server

--> create Ec2 instance T2-Medium

cd /opt/
yum install wget unzip -y
wget https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-7.6.zip
sudo amazon-linux-extras install java-openjdk11
sudo yum install java-1.8.0-openjdk
java -version
unzip sonarqube-7.6.zip
useradd sonar
visudo --> on editor bellow to root --> sonar ALL=(ALL) NOPASSWD:ALL save &
exit
chown -R sonar:sonar /opt/sonarqube-7.6
chmod -R 775 /opt/sonarqube-7.6
ls -l
su - sonar
cd /opt/
cd sonarqube-7.6/
ls
cd bin
ls -l
cd linux-x86-64
./sonar.sh start
./sonar.sh status
open url http://<ec2-public ip>:9000 : on URL Username:admin password:admin

sonarqube-pipline script
pipeline {
agent any
options {
buildDiscarder(logRotator(numToKeepStr: '5'))
}
stages {
stage('Scan') {
steps {
withSonarQubeEnv(installationName: 'sonarjenkins') {
sh './mvnw clean org.sonarsource.scanner.maven:sonar-maven-
plugin:3.9.0.2155:sonar'
}
}
}
stage("Quality Gate") {
steps {
timeout(time: 2, unit: 'MINUTES') {
waitForQualityGate abortPipeline: true
}
}
}
}
}

You might also like