How To Configure SonarQube on Ubuntu 16.04
Q. What is SonarQube ?
-- SonarQube is an open-source platform developed by SonarSource for continuous inspection of code quality to perform automatic reviews with static analysis of code to detect bugs, code smells, and security vulnerabilities on 20+ programming languages. SonarQube offers reports on duplicated code, coding standards, unit tests, code coverage, code complexity, comments, bugs, and security vulnerabilities.
SonarQube includes support for the programming languages Java (including Android), C#, PHP, JavaScript, TypeScript, C/C++, Ruby, Kotlin, Go, COBOL, PL/SQL, PL/I, ABAP, VB.NET, VB6, Python, RPG, Flex, Objective-C, Swift, CSS, HTML, and XML.
Requirements:
- Ubuntu 16.04 Server
- 2 GB of RAM to run efficiently and 1 GB of free RAM (Preferred 4 GB RAM)
- Disk Space: Depending on utilization (Preferred 50 GB)
- Instance volume type must be excellent read & write performance
- SonarQube does not support 32-bit systems on the server side.
- Open JDK 8 or Oracle Java 8
- Database MySQL 5.7 (Preferred MSSQL)
Installation:
Step: 1. Update System & Install required Packages :
# apt-get update && apt-get -y upgrade
# apt-get -y install -y wget unzip zip
Step: 2. Install Oracle Java :
# cd /opt
# mkdir java
# wget https://github.com/frekele/oracle-java/releases/download/8u212-b10/jdk-8u212-linux-x64.tar.gz
# tar -xzvf jdk-8u212-linux-x64.tar.gz -C /opt/java --strip-components=1
# update-alternatives --install /usr/bin/java java /opt/java/bin/java 100
# update-alternatives --install /usr/bin/javac javac /opt/java/bin/javac 100
# java -version
# echo $JAVA_HOME
Step: 3. Create user for SonarQube :
# sudo adduser --system --no-create-home --group --disabled-login sonarqube
Step: 4. Install MySQL Server & Create User for SonarQube :
# apt-get -y install mysql-server-5.7 mysql-server-core-5.7
# mysql_secure_installation
# mysql -u root -p
Enter Password:
MySQL> CREATE DATABASE sonardb CHARACTER SET utf8 COLLATE utf8_bin;
MySQL> GRANT ALL on sonardb.* TO 'sonarqube'@'localhost' IDENTIFIED BY 'sonardb#321';
MySQL> FLUSH PRIVILEGES;
MySQL> exit;
Step: 5. Install SonarQube :
# cd /opt/
# wget https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-7.7.zip
# unzip sonarqube-7.7.zip
# mv sonarqube-7.7 sonarqube
# sudo chown -R sonarqube:sonarqube /opt/sonarqube
# vi sonarqube/conf/sonar.properties
sonar.jdbc.username=sonarqube
sonar.jdbc.password=sonardb#321
sonar.jdbc.url=jdbc:mysql://localhost:3306/sonardb?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance&useSSL=false
sonar.web.javaOpts=-server
sonar.web.host=0.0.0.0
sonar.web.port=9000
sonar.web.context=/sonarqube (for If you want to web access like https://www.example.com/sonarqube)
-- Save & Quit (:wq)
Step: 6. Create Service for SonarQube :
# vi /etc/systemd/system/sonarqube.service
[Unit]
Description=SonarQube service
After=syslog.target network.target
[Service]
Type=forking
ExecStart=/opt/sonarqube/bin/linux-x86-64/sonar.sh start
ExecStop=/opt/sonarqube/bin/linux-x86-64/sonar.sh stop
User=sonarqube
Group=sonarqube
Restart=always
[Install]
WantedBy=multi-user.target
-- Save & Quit (:wq)
# systemctl daemon-reload
Step: 7. SonarQube Service Commands :
# service sonarqube start
# service sonarqube status
# service sonarqube stop
Step: 8. Install SonarScanner for Scanning :
# cd /opt
# wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-3.3.0.1492-linux.zip
# unzip sonar-scanner-cli-3.3.0.1492-linux.zip
# mv sonar-scanner-3.3.0.1492-linux sonarscanner
# sudo chown -R sonarqube:sonarqube /opt/sonarscanner
# vi sonarscanner/conf/sonar-scanner.properties
sonar.host.url=http://localhost:9000
-- Save & Quit (:wq)
# chmod +x sonarscanner/bin/sonar-scanner
# sudo ln -s /opt/sonarscanner/bin/sonar-scanner /usr/local/bin/sonar-scanner
Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog
Water Hack Burns 2 lb of Fat OVERNIGHT
ReplyDeleteAt least 160 000 men and women are losing weight with a simple and SECRET "water hack" to lose 2lbs each night while they sleep.
It's effective and works all the time.
This is how to do it yourself:
1) Grab a drinking glass and fill it up with water half the way
2) Proceed to follow this weight loss hack
and you'll be 2lbs lighter in the morning!
Awesome things you've generally imparted to us. Simply continue written work this sort of posts.The time which was squandered in going for educational cost now it can be utilized for studies to LINUX Thanks
ReplyDeleteDevOps Training in Chennai
DevOps Online Training in Chennai
DevOps Training in Bangalore
DevOps Training in Hyderabad
DevOps Training in Coimbatore
DevOps Training
DevOps Online Training
pusulabet
ReplyDeletesex hattı
https://izmirkizlari.com
rulet siteleri
rexbet
OC4L