- Continuous Integration,Delivery,and Deployment
- Sander Rossel
- 361字
- 2021-07-02 15:42:14
Installing SonarQube on Ubuntu
To install SonarQube on Ubuntu, we must first make sure we are on the correct Java version. You can check your version using the java -version command. It should be on 8. If you have followed this tutorial, your Java version will not be what SonarQube expects. So, let us first install Java. The add-apt-repository command is new to us. It adds a PPA, or Personal Package Archive, to the repository, telling Ubuntu it should look for updates from that specific package:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get -y install oracle-java8-installer
[Ok]
[Yes]
java -version
Now, we can download the SonarQube package and add it to the apt-get sources. You can find the installation steps in the documentation (http://docs.sonarqube.org/display/SONAR/Installing+the+Server). After that, we can update apt-get and install SonarQube. When prompted, choose to install without authentication:
sudo sh -c 'echo deb http://downloads.sourceforge.net/project/sonar-pkg/deb binary/ > /etc/apt/sources.list.d/sonarqube.list'
sudo apt-get update
sudo apt-get install sonar
Now, we need to tell SonarQube how to connect to our database. Open the sonar.properties file with sudo vi /opt/sonar/conf/sonar.properties. Near the top of the file, you will see sonar.jdbc.username= and sonar.jdbc.password=. Change them to sonar.jdbc.username=sonar and sonar.jdbc.password=sonar. After that, scroll further down the file and you will find the settings for PostgreSQL. The only thing you need to do is uncomment the line #sonar.jdbc.url=jdbc:postgresql://localhost/sonar by removing #.
Now, we only need to start SonarQube. You can start and stop it as follows, but do not run these commands just yet:
sudo service sonar start
sudo service sonar stop
Manually starting the SonarQube service whenever the server starts is not an option, so instead, we are going to make sure SonarQube starts at server startup and stops when the server shuts down:
sudo update-rc.d sonar defaults
sudo reboot
This will run sudo service sonar start and stop commands automatically at start and shutdown respectively (more specifically, it will run a sonar script with start or stop as a parameter).
Now, on your host machine, open a browser and browse to ciserver:9000. SonarQube may take a minute or two to start, so if it does not show immediately, try again in a minute.
- VMware View Security Essentials
- FreeSWITCH 1.6 Cookbook
- 羅克韋爾ControlLogix系統(tǒng)應(yīng)用技術(shù)
- Android Application Development Cookbook(Second Edition)
- Implementing Cisco Networking Solutions
- Java程序設(shè)計(jì)與實(shí)踐教程(第2版)
- Microsoft Dynamics GP 2013 Reporting, Second Edition
- Unity Game Development Scripting
- Protocol-Oriented Programming with Swift
- Java Web開發(fā)就該這樣學(xué)
- 持續(xù)集成與持續(xù)交付實(shí)戰(zhàn):用Jenkins、Travis CI和CircleCI構(gòu)建和發(fā)布大規(guī)模高質(zhì)量軟件
- Python 快速入門(第3版)
- C Primer Plus(第6版)中文版【最新修訂版】
- Manage Your SAP Projects with SAP Activate
- C#網(wǎng)絡(luò)編程高級篇之網(wǎng)頁游戲輔助程序設(shè)計(jì)