org.sonarsource.php,Sonarqube 代码质量管理平台搭建

Sonarqube官网

[http://www.sonarqube.org/]

获取安装包,当前为sonarqube-5.3.zip

Sonar介绍

Sonar (SonarQube)是一个开源平台,用于管理源代码的质量。Sonar 不只是一个质量数据报告工具,更是代码质量管理平台。支持的语言包括:Java、PHP、C#、C、Cobol、PL/SQL、Flex 等。

Sonar数据库创建

CREATE DATABASE sonar CHARACTER SET utf8 COLLATE utf8_general_ci;

CREATE USER 'sonar' IDENTIFIED BY 'sonar';

GRANT ALL ON sonar.* TO 'sonar'@'%' IDENTIFIED BY 'sonar';

GRANT ALL ON sonar.* TO 'sonar'@'localhost' IDENTIFIED BY 'sonar';

FLUSH PRIVILEGES;

Sonar数据库配置

$SONAR_HOME/conf/sonar.properties

sonar.jdbc.username=sonar

sonar.jdbc.password=sonar

sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance

sonar.jdbc.driverClassName=com.mysql.jdbc.Driver

Sonar端口配置

$SONAR_HOME/conf/sonar.properties

sonar.web.port=9999

Sonar JDK配置

$SONAR_HOME/conf/wrapper.conf

wrapper.java.command=/opt/test/lixr/jdk1.8.0_45/bin/java```

Sonar 启动

$SONAR_HOME/bin/linux-x86-64/sonar.sh start

Sonar自启动

vi /etc/init.d/sonar

!/bin/sh

rc file for SonarQube

chkconfig: 345 96 10

description: SonarQube system (www.sonarsource.org)

BEGIN INIT INFO

Provides: sonar

Required-Start: $network

Required-Stop: $network

Default-Start: 3 4 5

Default-Stop: 0 1 2 6

Short-Description: SonarQube system (www.sonarsource.org)

Description: SonarQube system (www.sonarsource.org)

END INIT INFO

/usr/bin/sonar $*

sudo ln -s $SONAR_HOME/bin/linux-x86-64/sonar.sh /usr/bin/sonar

sudo chmod 755 /etc/init.d/sonar

sudo chkconfig --add sonar

查看启动情况

$SONAR_HOME/logs/sonar.log

会自动创建数据库所需数据

Sonar 访问

http://192.168.220.126:9999/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值