devops-持续集成管理之SonarQube

1. devops-持续集成管理之SonarQube
  1) 代码质量七宗罪

编码规范:是否遵守了编码规范,遵循了最佳实践。
潜在的BUG:可能在最坏情况下出现问题的代码,以及存在安全漏洞的代码。
文档和注释:过少(缺少必要信息)、过多(没有信息量)、过时的文档或注释。
重复代码:违反了DontRepeat Yourself原则
复杂度:代码结构太复杂(如圈复杂度太高),难以理解、测试和维护。
测试覆盖率:编写单元测试,特别是针对复杂代码的测试覆盖是否足够。
设计与架构:是否高内聚、低耦合,依赖最少

2) 安装sonarqube
   (1) 官网地址: https://www.sonarqube.org/

安装包代码下载地址:https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-6.7.6.zip

(2) 代码扫描

3) 安装mysql数据库
  (1) 准备sonar数据库
  为sonar准备mysql数据库,版本必须大于5.6
  (2) 下载mysql二进制包

[[email protected] ~]# cd /usr/local/src
[[email protected] src]# wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.30-linux-glibc2.5-x86_64.tar.gz
[[email protected] src]# ll
total 438228
-rw-r--r-- 1 root root 314592758 Mar  3  2016 mysql-5.6.30-linux-glibc2.5-x86_64.tar.gz

(3) 创建mysql用户

[[email protected] ~]# groupadd mysql
[[email protected] ~]# useradd -r -g mysql -s /bin/false mysql

(4) 解压mysql二进制包

[[email protected] ~]# cd /usr/local/src/
[[email protected] src]# tar zxf mysql-5.6.30-linux-glibc2.5-x86_64.tar.gz
[[email protected] src]# mv mysql-5.6.30-linux-glibc2.5-x86_64 /usr/local/
[[email protected] src]# chown -R mysql.mysql /usr/local/mysql-5.6.30-linux-glibc2.5-x86_64
[[email protected] src]# ln -s /usr/local/mysql-5.6.30-linux-glibc2.5-x86_64 /usr/local/mysql
[[email protected] src]# ll /usr/local/
total 0
drwxr-xr-x.  2 root  root    6 Apr 11  2018 bin
drwxr-xr-x.  2 root  root    6 Apr 11  2018 etc
drwxr-xr-x.  2 root  root    6 Apr 11  2018 games
drwxr-xr-x.  2 root  root    6 Apr 11  2018 include
drwxr-xr-x.  2 root  root    6 Apr 11  2018 lib
drwxr-xr-x.  2 root  root    6 Apr 11  2018 lib64
drwxr-xr-x.  2 root  root    6 Apr 11  2018 libexec
lrwxrwxrwx   1 root  root   45 Jan 26 16:38 mysql -> /usr/local/mysql-5.6.30-linux-glibc2.5-x86_64
drwxr-xr-x  13 mysql mysql 191 Jan 26 16:37 mysql-5.6.30-linux-glibc2.5-x86_64
drwxr-xr-x.  2 root  root    6 Apr 11  2018 sbin
drwxr-xr-x.  5 root  root   49 Oct 24 21:37 share
drwxr-xr-x.  2 root  root   82 Jan 26 16:37 src
[[email protected] src]# chown -R mysql:mysql /usr/local/mysql

(5) 初始化mysql

[[email protected] src]# /usr/local/mysql/scripts/mysql_install_db --defaults-file=/usr/local/mysql/my.cnf  --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/
Installing MySQL system tables...2019-01-26 16:41:26 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2019-01-26 16:41:26 0 [Note] /usr/local/mysql//bin/mysqld (mysqld 5.6.30) starting as process 1650 ...
2019-01-26 16:41:26 1650 [Note] InnoDB: Using atomics to ref count buffer pool pages
2019-01-26 16:41:26 1650 [Note] InnoDB: The InnoDB memory heap is disabled
2019-01-26 16:41:26 1650 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-01-26 16:41:26 1650 [Note] InnoDB: Memory barrier is not used
2019-01-26 16:41:26 1650 [Note] InnoDB: Compressed tables use zlib 1.2.3
2019-01-26 16:41:26 1650 [Note] InnoDB: Using Linux native AIO
2019-01-26 16:41:26 1650 [Note] InnoDB: Using CPU crc32 instructions
2019-01-26 16:41:26 1650 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2019-01-26 16:41:26 1650 [Note] InnoDB: Completed initialization of buffer pool
2019-01-26 16:41:26 1650 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2019-01-26 16:41:26 1650 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2019-01-26 16:41:26 1650 [Note] InnoDB: Database physically writes the file full: wait...
2019-01-26 16:41:26 1650 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2019-01-26 16:41:26 1650 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2019-01-26 16:41:27 1650 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2019-01-26 16:41:27 1650 [Warning] InnoDB: New log files created, LSN=45781
2019-01-26 16:41:27 1650 [Note] InnoDB: Doublewrite buffer not found: creating new
2019-01-26 16:41:27 1650 [Note] InnoDB: Doublewrite buffer created
2019-01-26 16:41:27 1650 [Note] InnoDB: 128 rollback segment(s) are active.
2019-01-26 16:41:27 1650 [Warning] InnoDB: Creating foreign key constraint system tables.
2019-01-26 16:41:27 1650 [Note] InnoDB: Foreign key constraint system tables created
2019-01-26 16:41:27 1650 [Note] InnoDB: Creating tablespace and datafile system tables.
2019-01-26 16:41:27 1650 [Note] InnoDB: Tablespace and datafile system tables created.
2019-01-26 16:41:27 1650 [Note] InnoDB: Waiting for purge to start
2019-01-26 16:41:27 1650 [Note] InnoDB: 5.6.30 started; log sequence number 0
2019-01-26 16:41:27 1650 [Note] Binlog end
2019-01-26 16:41:27 1650 [Note] InnoDB: FTS optimize thread exiting.
2019-01-26 16:41:27 1650 [Note] InnoDB: Starting shutdown...
2019-01-26 16:41:29 1650 [Note] InnoDB: Shutdown completed; log sequence number 1625977
OK

Filling help tables...2019-01-26 16:41:29 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2019-01-26 16:41:29 0 [Note] /usr/local/mysql//bin/mysqld (mysqld 5.6.30) starting as process 1672 ...
2019-01-26 16:41:29 1672 [Note] InnoDB: Using atomics to ref count buffer pool pages
2019-01-26 16:41:29 1672 [Note] InnoDB: The InnoDB memory heap is disabled
2019-01-26 16:41:29 1672 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-01-26 16:41:29 1672 [Note] InnoDB: Memory barrier is not used
2019-01-26 16:41:29 1672 [Note] InnoDB: Compressed tables use zlib 1.2.3
2019-01-26 16:41:29 1672 [Note] InnoDB: Using Linux native AIO
2019-01-26 16:41:29 1672 [Note] InnoDB: Using CPU crc32 instructions
2019-01-26 16:41:29 1672 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2019-01-26 16:41:29 1672 [Note] InnoDB: Completed initialization of buffer pool
2019-01-26 16:41:29 1672 [Note] InnoDB: Highest supported file format is Barracuda.
2019-01-26 16:41:29 1672 [Note] InnoDB: 128 rollback segment(s) are active.
2019-01-26 16:41:29 1672 [Note] InnoDB: Waiting for purge to start
2019-01-26 16:41:29 1672 [Note] InnoDB: 5.6.30 started; log sequence number 1625977
2019-01-26 16:41:29 1672 [Note] Binlog end
2019-01-26 16:41:29 1672 [Note] InnoDB: FTS optimize thread exiting.
2019-01-26 16:41:29 1672 [Note] InnoDB: Starting shutdown...
2019-01-26 16:41:31 1672 [Note] InnoDB: Shutdown completed; log sequence number 1625987
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

  /usr/local/mysql//bin/mysqladmin -u root password ‘new-password‘
  /usr/local/mysql//bin/mysqladmin -u root -h jenkins password ‘new-password‘

Alternatively you can run:

  /usr/local/mysql//bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:

  cd . ; /usr/local/mysql//bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl

  cd mysql-test ; perl mysql-test-run.pl

Please report any problems at http://bugs.mysql.com/

The latest information about MySQL is available on the web at

  http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

New default config file was created as /usr/local/mysql//my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings

WARNING: Default config file /etc/my.cnf exists on the system
This file will be read by default by the MySQL server
If you do not want to use this, either remove it, or use the
--defaults-file argument to mysqld_safe when starting the server

(6) 拷贝启动文件

[[email protected] bin]# cp /usr/local/mysql/support-files/mysql.server   /etc/init.d/mysqld

(7) 拷贝my.cnf

[[email protected] bin]# cp /usr/local/mysql/my.cnf  /etc/my.cnf
cp: overwrite ‘/etc/my.cnf’? y

(8) 启动数据库

[[email protected] bin]# /etc/init.d/mysqld start
Starting MySQL. SUCCESS!

(9) 添加mysql环境变量

[[email protected] bin]# mysql
-bash: mysql: command not found               #提示没这个命令
[[email protected] bin]# echo ‘PATH=/usr/local/mysql/bin:$PATH‘ >> /etc/profile
[[email protected] bin]# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
[[email protected] bin]# source /etc/profile

(10) 登录数据库

[[email protected] bin]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.30 MySQL Community Server (GPL)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.

mysql> Ctrl-C -- exit!
Aborted
[[email protected] bin]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.30 MySQL Community Server (GPL)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| test               |
+--------------------+
4 rows in set (0.00 sec)

(11) 创建sonarqube数据库连接权限

mysql> CREATE DATABASE sonar CHARACTER SET utf8 COLLATE utf8_general_ci;
Query OK, 1 row affected (0.00 sec)

mysql> GRANT ALL ON sonar.* TO ‘sonar‘@‘localhost‘ IDENTIFIED BY ‘[email protected]‘;
Query OK, 0 rows affected (0.00 sec)

mysql> GRANT ALL ON sonar.* TO ‘sonar‘@‘%‘ IDENTIFIED BY ‘[email protected]‘;
Query OK, 0 rows affected (0.00 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

4)安装sonarqube

(1) 安装sonar

[[email protected] ~]# yum install -y java-1.8.0

 (2) 下载sonar

[[email protected] ~]# cd /usr/local/src/
[[email protected] src]# wget https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-6.7.6.zip
[[email protected] src]# ll
total 463092
-rw-r--r-- 1 root root 314592758 Mar  3  2016 mysql-5.6.30-linux-glibc2.5-x86_64.tar.gz
-rw-r--r-- 1 root root 159610886 Nov 20 20:23 sonarqube-6.7.6.zip

 (3) 解压sonar

[[email protected] src]# yum -y install unzip        #安装解压工具
[[email protected] src]# unzip sonarqube-6.7.6.zip
[[email protected] src]# ll
total 463092
-rw-r--r--  1 root root 314592758 Mar  3  2016 mysql-5.6.30-linux-glibc2.5-x86_64.tar.gz
drwxr-xr-x 11 root root       141 Nov 20 09:59 sonarqube-6.7.6
-rw-r--r--  1 root root 159610886 Nov 20 20:23 sonarqube-6.7.6.zip
[[email protected]  src]# mv sonarqube-6.7.6 /usr/local/
[[email protected] src]# ln -s /usr/local/sonarqube-6.7.6/ /usr/local/sonarqube

(4) 修改sonar配置文件

[[email protected] src]# cd /usr/local/sonarqube/conf/
[[email protected] conf]# ll
total 24
-rw-r--r-- 1 root root 17786 Nov 20 09:50 sonar.properties
-rw-r--r-- 1 root root  3311 Nov 20 09:50 wrapper.conf
[[email protected] conf]# vim sonar.properties                         #按照以下内容修改
sonar.web.host=0.0.0.0
sonar.web.port=9000
sonar.jdbc.username=sonar
[email protected]
sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance&useSSL=false

(5) 创建一个普通用户启动sonar程序

[[email protected] conf]# useradd sonarqube
[[email protected] conf]# chown -R sonarqube.sonarqube /usr/local/sonarqube-6.7.6
[[email protected] conf]# chown -R sonarqube.sonarqube /usr/local/sonarqube
[[email protected] conf]# su - sonarqube
[[email protected] ~]$ cd /usr/local/sonarqube
[[email protected] sonarqube]$ ll
total 12
drwxr-xr-x 8 sonarqube sonarqube  136 Nov 20 09:59 bin
drwxr-xr-x 2 sonarqube sonarqube   50 Jan 26 17:42 conf
-rw-r--r-- 1 sonarqube sonarqube 7651 Nov 20 09:50 COPYING
drwxr-xr-x 2 sonarqube sonarqube   24 Nov 20 09:50 data
drwxr-xr-x 7 sonarqube sonarqube  150 Nov 20 09:59 elasticsearch
drwxr-xr-x 4 sonarqube sonarqube   40 Nov 20 09:50 extensions
drwxr-xr-x 9 sonarqube sonarqube  140 Nov 20 09:59 lib
drwxr-xr-x 2 sonarqube sonarqube   37 Jan 26 17:39 logs
drwxr-xr-x 3 sonarqube sonarqube   38 Jan 26 17:35 temp
drwxr-xr-x 9 sonarqube sonarqube 4096 Nov 20 09:59 web
[[email protected] sonarqube]$ ll /usr/local/sonarqube/bin/
jsw-license/         linux-x86-32/        linux-x86-64/        macosx-universal-64/ windows-x86-32/      windows-x86-64/
[[email protected] sonarqube]$ ll /usr/local/sonarqube/bin/linux-x86-64/
lib/      sonar.sh  wrapper
[[email protected] sonarqube]$  /usr/local/sonarqube/bin/linux-x86-64/sonar.sh start
Starting SonarQube...
Started SonarQube.

(6) 验证是否启动

[[email protected] sonarqube]$ ps -ef |grep sonarqube
root       2322   1559  0 17:43 pts/2    00:00:00 su - sonarqube
sonarqu+   2442      1  0 17:43 ?        00:00:00 /usr/local/sonarqube-6.7.6/bin/linux-x86-64/./wrapper /usr/local/sonarqube-6.7.6/bin/linux-x86-64/../../conf/wrapper.conf wrapper.syslog.ident=SonarQube wrapper.pidfile=/usr/local/sonarqube-6.7.6/bin/linux-x86-64/./SonarQube.pid wrapper.daemonize=TRUE
sonarqu+   2469   2444 39 17:43 ?        00:00:32 /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64/jre/bin/java -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+AlwaysPreTouch -server -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -Djdk.io.permissionsUseCanonicalPath=true -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Dlog4j.skipJansi=true -Xms512m -Xmx512m -XX:+HeapDumpOnOutOfMemoryError -Des.path.home=/usr/local/sonarqube-6.7.6/elasticsearch -cp /usr/local/sonarqube-6.7.6/elasticsearch/lib/* org.elasticsearch.bootstrap.Elasticsearch -Epath.conf=/usr/local/sonarqube-6.7.6/temp/conf/es
sonarqu+   2557   2444 51 17:44 ?        00:00:38 /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64/jre/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/usr/local/sonarqube-6.7.6/temp -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -cp ./lib/common/*:./lib/server/*:/usr/local/sonarqube-6.7.6/lib/jdbc/mysql/mysql-connector-java-5.1.42.jar org.sonar.server.app.WebServer /usr/local/sonarqube-6.7.6/temp/sq-process5217028904409453940properties
sonarqu+   2734   2444 29 17:44 ?        00:00:12 /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64/jre/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/usr/local/sonarqube-6.7.6/temp -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -cp ./lib/common/*:./lib/server/*:./lib/ce/*:/usr/local/sonarqube-6.7.6/lib/jdbc/mysql/mysql-connector-java-5.1.42.jar org.sonar.ce.app.CeServer /usr/local/sonarqube-6.7.6/temp/sq-process4860119420686879380properties

[[email protected] sonarqube]$ netstat -lntup|grep 9000
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 0.0.0.0:9000            0.0.0.0:*               LISTEN      2557/java

(7)浏览器访问

(8) 首次登陆默认登陆用户admin、登陆密码admin
  (9) 汉化界面
  安装汉化包试试:页面上找到Administration > Marketplace,在搜索框中输入chinese,出现一个Chinese Pack,点击右侧的install按钮。
  安装成功后,会提示重启 SonarQube 服务器。

原文地址:https://www.cnblogs.com/scajy/p/12597215.html

时间: 2024-11-09 08:24:00

devops-持续集成管理之SonarQube的相关文章

DevOps - 持续集成(Continuous Integration)

持续集成 持续集成(Continuous integration,简称CI)是软件的开发和发布标准流程中最重要的部分. 简单来说,就是持续不断地(一天多次)将代码合并(集成)到主干源码仓库,让产品可以快速迭代,同时保持高质量. 代码每次集成到主干之前,必须通过自动化测试,以便快速发现和定位错误. 持续集成并不能消除Bug,而是让它们非常容易发现和改正. 典型的CI流程 通用的CI流程 签出代码: 从源码管理系统里签出或者克隆最新的代码到本地开发环境 提交(commit): 基于主干分支创建一个新

Azure DevOps 持续集成CI 配置

1.获取数据源  Select a scurce 2.NuGet restore,如有自定义的包 可以添加NuGet.config 3.Build Solution. (MSBuild Arguments :/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifa

[持续交付实践] 基于 sonarqube 的代码检查平台实现

前言 公司此前用的一直是的SonarQube5.1(2015年版本,为兼容jdk6和jdk7的项目一直没有升级),最近为了pipeline的集成刚刚升级到了最新的SonarQube6.5版本.网上对SonarQube6的介绍比较少,这里重点先介绍下SonarQube6以后的一些新增特性.1.代码问题重新分级,将问题分为bug.漏洞.坏味道:将代码检查结果从可靠性.安全性.可维护性几个角度进行问题分类和风险分级.2.更丰富的代码检查规则,更友好的问题处理曲线展示,更清晰的质量阈和代码规则定制.3.

持续集成篇--Hudson持续集成服务器的安装配置与使用

IP:192.168.4.221  8G内存(Hudson多个工程在同时构建的情况下比较耗内存) 环境:CentOS 6.6.JDK7 Hudson不需要用到数据库 参考:http://www.roncoo.com/index.html Hudson只是一个持续集成服务器(持续集成工具),要想搭建一套完整的持续集成管理平台,还需要用到前面课程中所讲到的SVN.Maven.Sonar等工具,按需求整合则可. 1.  安装JDK并配置环境变量(略) JAVA_HOME=/usr/local/java

持续集成(一):什么是持续集成(CI)、持续交付(CD)和持续部署(CD)

持续集成.持续交付和持续部署 持续集成 Continuous Integration:持续集成,简称CI,是软件开发周期的一种实践,把代码仓库(Gitlab或者Github).构建工具(如Jenkins)和测试工具(SonarQube)集成在一起,频繁的将代码合并到主干然后自动进行构建和测试. 其实这里最关键的是自动化测试,这个是最难的,因为测试涉及内容很多. 持续交付 Continuous Delivery:持续交付,简称CD,是在CI的基础进行了扩展,在CI环节完成了软件构建和测试工作并形成

linux学习:持续集成篇--简介-01

1.持续集成介绍 持续集成是一种软件开发实践 团队开发成员经常集成他们的工作,每次集成都通过自动化构建(包括自动化编译.测试.发布)来验证,从而尽快的发现集成错误 持续集成的价值.要素.原则 原则 1. 所有的开发人员需要在本地机器上做本地构建,然后再提交的版本控制库中,从而确保他们的变更不会导致持续集成失败. 2. 开发人员每天至少向版本控制库中提交一次代码. 3. 开发人员每天至少需要从版本控制库中更新一次代码到本地机器. 4. 需要有专门的集成服务器来执行集成构建,每天要执行多次构建. 5

持续集成篇-Maven私有库和本地库的安装与配置Sonatype Nexus + Maven

持续集成管理平台的组成与工作原理图 如果构建的Maven项目本地仓库没有对应的依赖包,那么就会去Nexus私服去下载, 那么如果Nexus私服也没有此依赖包,就回去远程中央仓库下载依赖, Nexus私服下载成功后再下载至本地Maven库供项目引用. 环境:CentOS 6.6 Final.JDK7.Sonatype Nexus.Maven IP:192.168.103.212 root 用户操作 前提:已安装 JDK7 并配置好了环境变量 1.下载最新版 Nexus(本教程使用的是:nexus-

转载:持续集成Jenkins+sonarqube部署教程

转载: 持续集成Jenkins+sonarqube部署教程 持续集成 1 引言 1.1 文档概要 本文主要介绍jenkins,sonar的安装与集成,基于ant,maven构建.用一个例子介绍jenkins的编译打包部署,代码检查.最后集成jenkins.(现阶段只是简易的集成,后续需要修改accio源码做深度集成) 1.2 预计读者 系统配置管理员:要懂得搭建持续集成环境,有问题可以排查:架构师:了解持续集成实现原理,协助项目接入持续集成.项目在持续集成环境运行中,进行维护.分析构建异常等:维

持续集成Jenkins+sonarqube部署教程

1 引言 1.1 文档概要 本文主要介绍jenkins,sonar的安装与集成,基于ant,maven构建.用一个例子介绍jenkins的编译打包部署,代码检查.最后集成jenkins.(现阶段只是简易的集成,后续需要修改accio源码做深度集成) 1.2 预计读者 系统配置管理员:要懂得搭建持续集成环境,有问题可以排查:架构师:了解持续集成实现原理,协助项目接入持续集成.项目在持续集成环境运行中,进行维护.分析构建异常等:维护人员:重启服务.排查环境问题.项目接入支持: 1.3 关于持续集成

linux学习:持续集成篇--sonarqube代码质量管理平台的介绍与安装-04

1.SonarQube的介绍 官网:https://www.sonarqube.org/ SonarQube是一个管理代码质量的开放平台.  1.1 可以从七个维度检测代码质量(为什么要用SonarQube) (1)复杂度分布(complexity):代码复杂度过高将难以理解.难以维护 (2)重复代码(duplications):程序中包含大量复制粘贴的代码是质量低下的表现 (3)单元测试(unit tests):统计并展示单元测试覆盖率 (4)编码规范(coding rules):通过Find