当前位置:网站首页>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
边栏推荐
- Pytorch notes - get familiar with the network construction method by building RESNET (complete code)
- filebrowser实现私有网盘
- 线代第四章-向量组的线性相关
- Write your own redistemplate
- 编写一个自己的 RedisTemplate
- Font shape `OMX/cmex/m/n‘ in size <10.53937> not available (Font) size <10.95> substituted.
- Pytoch learning record (x): data preprocessing + batch normalization (BN)
- Preparedstatement prevents SQL injection
- Fundamentals of in-depth learning -- a simple understanding of meta learning (from Li Hongyi's course notes)
- 异常的处理:抓抛模型
猜你喜欢

PyQt5学习(一):布局管理+信号和槽关联+菜单栏与工具栏+打包资源包

Pytorch学习记录(三):神经网络的结构+使用Sequential、Module定义模型

编程记录——图片旋转函数scipy.ndimage.rotate()的简单使用和效果观察

域内用户访问域外samba服务器用户名密码错误

Pytorch learning record (7): skills in processing data and training models

Pytoch -- data loading and processing

PyQy5学习(二):QMainWindow+QWidget+QLabel

深入理解去噪论文——FFDNet和CBDNet中noise level与噪声方差之间的关系探索
![Reading of denoising paper - [ridnet, iccv19] real image denoising with feature attention](/img/4e/1a51636853d11544e6f5c37a588730.png)
Reading of denoising paper - [ridnet, iccv19] real image denoising with feature attention
![Paper on Image Restoration - [red net, nips16] image restoration using very deep revolutionary encoder decoder networks wi](/img/1b/4eea05e2634780f45b44273d2764e3.png)
Paper on Image Restoration - [red net, nips16] image restoration using very deep revolutionary encoder decoder networks wi
随机推荐
Pytorch learning record (V): back propagation + gradient based optimizer (SGD, adagrad, rmsporp, Adam)
给yarn配置国内镜像加速器
String notes
Fundamentals of digital image processing (Gonzalez) II: gray transformation and spatial filtering
Automatic control (Han min version)
Linear algebra Chapter 2 - matrices and their operations
JDBC tool class encapsulation
redhat实现目录下特定文本类型内关键字查找及vim模式下关键字查找
What is the difference between the basic feasible solution and the basic feasible solution in linear programming?
Anaconda installed pyqt5 and pyqt5 tools without designer Exe problem solving
interviewter:介绍一下MySQL日期函数
Pytorch学习记录(十三):循环神经网络((Recurrent Neural Network)
图像恢复论文简记——Uformer: A General U-Shaped Transformer for Image Restoration
PyTorch笔记——通过搭建ResNet熟悉网络搭建方式(完整代码)
Programming record - picture rotation function SciPy ndimage. Simple use and effect observation of rotate()
Linear algebra Chapter 1 - determinant
Common programming records - parser = argparse ArgumentParser()
Pytorch——数据加载和处理
EditorConfig
深入源码分析Servlet第一个程序