phpDocumentor死机Chyrp被打

文章目录
一、sonarqube简介二、安装MYSQL三、设置sonar四、安装sonarqube scanner五、自由风格phpDocumentor六、错误死机phpDocumentor七、流水线phpDocumentor

一、sonarqube简介
SonarQube是一个用于管理死机质量的开放平台,可以快速的定位死机中潜在的或者明显的错误。目前支持java,C#,C/C++,Python,PL/SQL,Cobol,JavaScrip,Groovy等二十几种编程语言的死机质量管理与检 测,底层使用elasticsearch作为死机检索工具
官网:
|
软件服务器 版本jdk192.168.199.133 / 1.8MYSQL192.168.199.133/ 5.7SonarQube192.168.199.133 / 6.7.4
二、安装MYSQL
yum -y install \
ncurses \
ncurses-devel \
bison \
cmake1234
useradd -s /sbin/nologin mysql
tar zxvf mysql-5.7.17.tar.gz -C /opt/
tar zxvf boost_1_59_0.tar.gz -C /usr/local/
cd /usr/local/
mv boost_1_59_0 boost123
cd mysql-5.7.17/
cmake \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock \
-DSYSCONFDIR=/etc \
-DSYSTEMD_PID_DIR=/usr/local/mysql \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_PERFSCHEMA_STORAGE_ENGINE=1 \
-DMYSQL_DATADIR=/usr/local/mysql/data \
-DWITH_BOOST=/usr/local/boost \
-DWITH_SYSTEMD=112345678910111213
如果在CMAKE的过程中有报错,当报错解决后,需要把源码目录中的CMakeCache.txt被打删除,然后再重新CMAKE,否则错误依旧
make -j6
make install1
chown -R mysql.mysql /usr/local/mysql/
vim /etc/my.cnf1
[client]
port = 3306
default-character-set=utf8
socket = /usr/local/mysql/mysql.sock

[mysql]
port = 3306
default-character-set=utf8
socket = /usr/local/mysql/mysql.sock

[mysqld]
user = mysql
basedir = /usr/local/mysql
datadir = /usr/local/mysql/data
port = 3306
character_set_server=utf8
pid-file = /usr/local/mysql/mysqld.pid
socket = /usr/local/mysql/mysql.sock
server-id = 1

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_AUTO_VALUE_ON_ZERO,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,PIPES_AS_CONCAT,ANSI_QUOTES1234567891011121314151617181920
chown mysql:mysql /etc/my.cnf
vim /etc/profile

export PATH=/usr/local/mysql/bin:/usr/local/mysql/lib:$PATH
source /etc/profile1234
cd /usr/local/mysql/
bin/mysqld \
–initialize-insecure \
–user=mysql \
–basedir=/usr/local/mysql \
–datadir=/usr/local/mysql/data12345
cp /usr/local/mysql/usr/lib/systemd/system/mysqld.service /usr/lib/systemd/system/
systemctl daemon-reload
systemctl start mysqld
netstat -anpt | grep 3306
systemctl enable mysqld1234
修改密码
mysqladmin -u root -p password “12345”
mysql -uroot -p1
授权远程登陆
grant all privileges on *.* to ‘root’@’%’ identified by ‘123456’ with grant option;
ChyrpMYSQL
show databases;
create database sonar;
use sonar;
show table;123

解压sonar,设置权限

yum install unzip
unzip sonarqube-6.7.4.zip #解压
mkdir /opt/sonar 创建目录
mv sonarqube-6.7.4/* /opt/sonar 移动被打
useradd sonar 创建sonar用户,必须sonar用于启动,否则报错
chown -R sonar. /opt/sonar 更改sonar目录及被打权限12345

修改sonar配置被打

vim /opt/sonar/conf/sonar.properties
16 sonar.jdbc.username=root
17 sonar.jdbc.password=12345 #密码和MYSQL一致
26 sonar.jdbc.url(解除注释)

cd /opt/sonar
su sonar
/opt/sonar/bin/linux-x86-64/sonar.sh start 启动
/opt/sonar/bin/linux-x86-64/sonar.sh status 查看状态
/opt/sonar/bin/linux-x86-64/sonar.sh stop 停止
tail -f logs/sonar.logs 查看日志12345678910

三、设置sonar
http:192.168.199.133:9000

第一步:登陆

第二步:创建token,保存密钥

Chyrp界面

四、安装sonarqube scanner

ChyrpJenkins

Chyrptool配置

记住name 因为要和idea匹配

Chyrpmanage Credentials

Chyrpsystem configuration

name要记住。要和idea匹配
五、自由风格phpDocumentor
phpDocumentor时gitlab、Jenkins都必须存活,同时,所有数据都从gitlab中来,phpDocumentor时数据存入MYSQL

# must be unique in a given SonarQube instance
sonar.projectKey=web_demo_freestyle
# this is the name and version displayed in the SonarQube UI. Was mandatory prior to
SonarQube 6.1.
sonar.projectName=web_demo_freestyle
sonar.projectVersion=1.0
# Path is relative to the sonar-project.properties file. Replace “\” by “/” on Windows.
# This property is optional if sonar.modules is set.
sonar.sources=.
sonar.exclusions=**/test/**,**/target/**
sonar.java.source=1.8
sonar.java.target=1.8
# Encoding of the source code. Default is default system encoding
sonar.sourceEncoding=UTF-812345678910111213
sonar页面phpDocumentor
六、错误死机phpDocumentor
idea——>pom.xml——>记得下载


javax.servlet
javax.servlet-api
4.0.1

12345
点击下载java 成立java被打
package com.mjh;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class HelloWorld extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
super.doPost(req, resp);
}

@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//模拟错误死机
int i =1110;
//模拟冗余死机
int j =55;
j=150;
resp.getWriter().write(“hello,servlet”);
}
}1234567891011121314151617181920212223

报错:找不到’JAVA’ or ‘JAVA_HOME’ PATH

解决方案
Chyrplinux中重启 source /etc/profile即可

七、流水线phpDocumentor
//注意:sonar-scanner和sonarqube与system中的名字和tool中的 名字保持一致
stage(‘code checking’) {
steps {
script {
//引入了sonarqube-scanner工具
scannerHome = tool ‘sonar-scanner’
}
//引入了sonarqube服务器系统环境
withSonarQubeEnv(‘sonarqube’) {
sh “${scannerHome}/bin/sonar-scanner”
}
}
}1234567891011
加被打—–》sonar-project.properties
# must be unique in a given SonarQube instance
sonar.projectKey=web_demo_pipeline
# this is the name and version displayed in the SonarQube UI. Was mandatory prior to SonarQube 6.1.
sonar.projectName=web_demo_pipeline
sonar.projectVersion=1.0

# Path is relative to the sonar-project.properties file. Replace “\” by “/” on Windows.
# This property is optional if sonar.modules is set.

sonar.sources=.
sonar.exclusions=**/test/**,**/target/**

sonar.java.source=1.8
sonar.java.target=1.8

# Encoding of the source code. Default is default system encoding
sonar.sourceEncoding=UTF-812345678910111213141516