1.下载文件http://mirrors.shu.edu.cn/jenkins/war-stable/2.89.3/jenkins.war jenkins.war,拷贝tomcat webapps,目录
2.网页打开输入密码,密码在tomcat log文件里面
3.安装插件
二、sonarqube
unzip -q sonarqube-6.7.1.zip /usr/
不能用ROOT,改为其他用户
useradd -g root
passwd
修改 SonarQube 配置
# Permissions to create tables, indices and triggers must be granted to JDBC user.
# The schema must be created first.
sonar.jdbc.username=sonar
sonar.jdbc.password=Sonar6.2
#----- Embedded Database (default)
# H2 embedded database server listening port, defaults to 9092
#sonar.embeddedDatabase.port=9092
#----- MySQL 5.6 or greater
# Only InnoDB storage engine is supported (not myISAM).
# Only the bundled driver is supported. It can not be changed.
sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance&useSSL=false
# The schema must be created first.
sonar.jdbc.username=sonar
sonar.jdbc.password=Sonar6.2
#----- Embedded Database (default)
# H2 embedded database server listening port, defaults to 9092
#sonar.embeddedDatabase.port=9092
#----- MySQL 5.6 or greater
# Only InnoDB storage engine is supported (not myISAM).
# Only the bundled driver is supported. It can not be changed.
sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance&useSSL=false
# Binding IP address. For servers with more than one IP address, this property specifies which
# address will be used for listening on the specified ports.
# By default, ports will be used on all IP addresses associated with the server.
sonar.web.host=0.0.0.0
# Web context. When set, it must start with forward slash (for example /sonarqube).
# The default value is root context (empty value).
sonar.web.context=/sonar
# TCP port for incoming HTTP connections. Default value is 9000.
sonar.web.port=9000
修改文件所有者 chown -R k:root .
启动服务
/opt/sonarqube-6.2/bin/linux-x86-64/sonar.sh stop ## 停止服务
/opt/sonarqube-6.2/bin/linux-x86-64/sonar.sh start ## 启动服务
/opt/sonarqube-6.2/bin/linux-x86-64/sonar.sh restart ## 重启服务
/opt/sonarqube-6.2/bin/linux-x86-64/sonar.sh console ## 控制台启动
tail -f /opt/sonarqube-6.2/logs/sonar.log ## 查看日志
Execute the SonarQube Scanner for Gradle from your computer
Running a SonarQube analysis with Gradle is straighforward. You just need to declare the org.sonarqube
plugin in your build.gradle
file:
plugins { id "org.sonarqube" version "2.5" }
and run the following command:
./gradlew sonarqube \ -Dsonar.host.url=http://192.168.0.101:9000/sonar \ -Dsonar.login=cdf79b8ec94f0c67963dc32edfb7c1c79748ac53