SonarQube系列 目錄
- SonarQube (1) 基本環境搭建
- SonarQube (2) sonar runner安裝配置
- SonarQube (3) C++插件安裝與規則配置
- SonarQube (4) 運行一個Sample
- SonarQube (5) 集成至Jenkins
- SonarQube (終) Gitlab提交代碼自動化測試
下載SonarQube Runner安裝包
https://docs.sonarqube.org/display/SONARQUBE45/Installing+and+Configuring+SonarQube+Runner
sonar-runner壓縮包下載: SonarQube Runner
sonar-scanner壓縮包下載: SonarQube Scanner
解壓至任一目錄(/etc/)
配置SonarQube Runner
vi /etc/conf/sonar-runner.properties
#----- PostgreSQL
sonar.jdbc.url=jdbc:postgresql://localhost/sonar
#----- Global database settings
sonar.jdbc.username=sonar
sonar.jdbc.password=YOUR_PASSWORD
創建SONAR_RUNNER_HOME環境變量
vi /etc/profile.d/sonarrc.sh
export SONAR_RUNNER_HOME=/etc/sonar-runner
export PATH=$PATH:$SONAR_RUNNER_HOME/bin
source /etc/profile.d/sonarrc.sh
驗證
sonar-runner -h
參考
https://docs.sonarqube.org/display/SONARQUBE45/Installing+and+Configuring+SonarQube+Runner