Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the implementation code testing process of jenkins and sonar?

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article is about how the code testing process of jenkins and sonar implementation is like. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

First, install the client of sonar scanner

My jenkins version is 2.176.2

To install sonar, you need to install the client and the server. Here we only describe the relevant configuration of the client. Installation steps are omitted

Second, then configure the environment variables of sonar scanner

Edit the server's profile file

Vim / etc/profile, add environment variables

Export MAVEN_HOME=/opt/servers/apache-maven-3.6.1export SONAR_SCANNER_HOME=/opt/sonar-scanner

Third, first install the plug-ins required by jenkins

4. Configure configuration of SonarQube servers

Here, you need to configure the address and account of the sonar server, because my version only provides token, and token needs to be obtained from the sonnar server. The specific way needs to be found separately.

Note: there are only ip and port behind the url here, but no / sonar, otherwise an error will be reported when configuring job later.

Configure the global configuration of sonar

Create a job and add the configuration information of the sonar scanner

First of all, you need to check here to indicate that the code is checked before the code is built.

Create the first task in job, create Execute SonarQube Scanner

Fill in the property information in the pop-up form

The properties here overwrites the sonar-project.properties file in the project by default, so after you configure it here, you don't need to add files to the project.

Thank you for reading! On "jenkins and sonar code testing process is how" this article is shared here, I hope the above content can be of some help to you, so that you can learn more knowledge, if you think the article is good, you can share it out for more people to see it!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report