当前位置:网站首页>2. Devops sonar installation
2. Devops sonar installation
2022-04-23 06:03:00 【Pingszi】
1. The goal is
install sonar Community Edition 8.9.1, And with gitlab Integrate , Code check ;
2. Installation steps
2.1. Create data mount directory
mkdir -p /data/sonar
#** Third party extensions
mkdir /data/sonar/extensions
#** Data files , such as es(sonarqube rely on , Built in the official image es)
mkdir /data/sonar/data
#** Log files
mkdir /data/sonar/logs
2.2. install sonar
sonar The new version does not support mysql, Need to rely on postgresql database ;
- sonar.jdbc.url:postgresql Database connection information ;
- sonar.jdbc.username=postgres postgresql Database user name
- sonar.jdbc.password=postgres postgresql Database password
docker run -d --name sonar \
-p 8002:9000 \
-e sonar.jdbc.url=jdbc:postgresql://172.6.0.12:8434/sonar \
-e sonar.jdbc.username=postgres \
-e sonar.jdbc.password=postgres \
-v /data/sonar/extensions:/opt/sonarqube/extensions \
-v /data/sonar/logs:/opt/sonarqube/logs \
-v /data/sonar/data:/opt/sonarqube/data \
sonarqube:8.9.1-community
Access path :http://127.0.0.1:8002, user name / password :admin/admin
2.3. Sinicization
In the data mount directory of the host data/sonar/extensions/downloads Download the Chinese package , Pay attention to the of Chinese package sonar The versions should be consistent ;
#** Download the Chinese package
wget https://github.com/xuhuisheng/sonar-l10n-zh/releases/download/sonar-l10n-zh-plugin-8.9/sonar-l10n-zh-plugin-8.9.jar
#** Restart container
docker restart sonar
3. Use
3.1. Create token
Click on The avatars > My account number > Security > Fill in the token name > Generate
3.2.gitlab-cicd Integrate
Submit code to gitlab develop After the branch , Automatic operation sonar Code checking ;
- modify gitlab Environmental maven The configuration file setting.xml
<profiles>
<!-- sonar To configure -->
<profile>
<id>sonar</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- sonar Address -->
<sonar.host.url>http://172.6.0.10:8002/</sonar.host.url>
<!-- The token created in the previous step -->
<sonar.login>cce44014dc5496c9c444a2cf1fde46cd735120b</sonar.login>
</properties>
</profile>
</profiles>
<activeProfiles>
<!-- sonar To configure -->
<activeProfile>sonar</activeProfile>
</activeProfiles>
- Modification item .gitlab-ci.yml To configure
# Development branch sonar Quality inspection
sonar:dev:
stage: sonar
image: $REGISTRY/gaojie/maven:3-jdk-8
variables:
#** The token created in the previous step
SONAR_TOKEN: "cce44014dc5496c9c444a2cf1fde46cd735120b"
#**sonar Address
SONAR_HOST_URL: "http://172.6.0.10:8002/"
GIT_DEPTH: 0
script:
- mvn verify sonar:sonar
allow_failure: true
only:
- develop
4. Problems encountered
Boot failure :max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
- solve : modify docker The host machine es To configure /etc/sysctl.conf
vim /etc/sysctl.conf
Add parameter :vm.max_map_count=262144
sysctl -p
版权声明
本文为[Pingszi]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230540524618.html
边栏推荐
- CONDA virtual environment management (create, delete, clone, rename, export and import)
- Solution record of slow access speed of SMB service in redhat6
- Pytorch学习记录(九):Pytorch中卷积神经网络
- Dva中在effects中获取state的值
- 常用编程记录——parser = argparse.ArgumentParser()
- Use Matplotlib. In Jupiter notebook Pyplot server hangs up and crashes
- filebrowser实现私有网盘
- Create enterprise mailbox account command
- Pytorch学习记录(十):数据预处理+Batch Normalization批处理(BN)
- protected( 被 protected 修饰的成员对于本包和其子类可见)
猜你喜欢
PyTorch笔记——实现线性回归完整代码&手动或自动计算梯度代码对比
Reading of denoising papers - [cvpr2022] blind2blind: self supervised image denoising with visible blind spots
Pytorch Learning record (XIII): Recurrent Neural Network
Pyqy5 learning (III): qlineedit + qtextedit
图像恢复论文——[RED-Net, NIPS16]Image Restoration Using Very Deep Convolutional Encoder-Decoder Networks wi
Linear algebra Chapter 2 - matrices and their operations
Font shape `OMX/cmex/m/n‘ in size <10.53937> not available (Font) size <10.95> substituted.
Linear algebra Chapter 1 - determinant
Pytorch notes - complete code for linear regression & manual or automatic calculation of gradient code comparison
基于thymeleaf实现数据库图片展示到浏览器表格
随机推荐
Treatment of tensorflow sequelae - simple example record torch utils. data. dataset. Picture dimension problem when rewriting dataset
You cannot access this shared folder because your organization's security policy prevents unauthenticated guests from accessing it
无监督去噪——[TMI2022]ISCL: Interdependent Self-Cooperative Learning for Unpaired Image Denoising
Solve the error: importerror: iprogress not found Please update jupyter and ipywidgets
线性规划问题中可行解,基本解和基本可行解有什么区别?
线性代数第三章-矩阵的初等变换与线性方程组
Pytorch learning record (7): skills in processing data and training models
域内用户访问域外samba服务器用户名密码错误
RedHat6之smb服务访问速度慢解决办法记录
Fact final variable and final variable
Remedy after postfix becomes a spam transit station
Pytorch notes - observe dataloader & build lenet with torch to process cifar-10 complete code
实操—Nacos安装与配置
Postfix变成垃圾邮件中转站后的补救
Anaconda
Pytoch -- data loading and processing
Pytorch學習記錄(十三):循環神經網絡((Recurrent Neural Network)
Pyqy5 learning (4): qabstractbutton + qradiobutton + qcheckbox
What is the difference between the basic feasible solution and the basic feasible solution in linear programming?
redhat实现目录下特定文本类型内关键字查找及vim模式下关键字查找