How to Install SonarQube on CentOS 7
SonarQube is an open source tool for quality system development. It is written in Java and supports multiple databases. It provides capabilities to continuously inspect code, show the health of an application, and highlight newly introduced issues. It contains code analyzers which are equipped to detect tricky issues. It also integrates easily with DevOps.
Homepage:- https://www.sonarqube.org/
Download Link:- https://www.sonarqube.org/downloads/
java -version
rpm -Uvh https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm
yum -y install postgresql96-server postgresql96-contrib
/usr/pgsql-9.6/bin/postgresql96-setup initdb
nano /var/lib/pgsql/9.6/data/pg_hba.conf
systemctl start postgresql-9.6 && systemctl enable postgresql-9.6
passwd postgres
su – postgres
createuser sonar
psql
ALTER USER sonar WITH ENCRYPTED password ‘sonar’;
CREATE DATABASE sonar OWNER sonar;
q
wget https://sonarsource.bintray.com/Distribution/sonarqube/sonarqube-6.4.zip
unzip sonarqube-6.4.zip -d /opt
mv /opt/sonarqube-6.4 /opt/sonarqube
nano /opt/sonarqube/conf/sonar.properties
sonar.jdbc.username=sonar
sonar.jdbc.password=sonar
sonar.jdbc.url=jdbc:postgresql://localhost/sonar
nano /etc/systemd/system/sonar.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=root
Group=root
Restart=always
[Install]
WantedBy=multi-user.target
systemctl start sonar && sudo systemctl enable sonar && sudo systemctl status sonar
admin
admin
======================================================
centos 7