Continuous Integration

Reference documentation:

http://www.mamicode.com/info-detail-1632815.html

https://blog.csdn.net/xlgen157387/article/details/50353317

https://www.ibm.com/developerworks/cn/devops/1612_qusm_jenkins/index.html

Sonar multi-module https://blog.csdn.net/clamaa/article/details/70045970

https://www.jianshu.com/p/e1a9409643e9

Get token: System Management - Manage Users - User List - Click in admin - Left Sidebar - Settings

ssh info: System Administration - System Settings

 

Download Plugin Manager

WebHook plugin

SSH plugin

Git plugin

Sonar plugin

 

Configure jdk/maven/git and other information: global tool configuration

 

 

 

 

New Project:

 

Configure the old build strategy

 

Configure the source code git information for the build

 

Configure Maven Build Commands

 

clean install -e -U

 

The operation of restarting the service after the build

 

Code cloud configuration webhook

1) After entering the project, click Manage

 

2) Find the WebHooks configuration interface, and enter the following format in the POST address box:

final input

http://chenyao:[email protected]:9007/generic-webhook-trigger/invoke

The password behind the URL is the account password of the jenkins user admin.

jenkins username and password: admin/admin

After clicking Submit, the interface is as follows:

3) Click to test

return successfully

 

Configure Sonar

sonar.projectKey = banke-boot

sonar.projectName=banke-boot

sonar.projectVersion=0.0.1-SNAPSHOT

sonar.sourceEncoding=UTF-8

sonar.language=java

sonar.scm.disabled=true

sonar.modules=java-module

sonar.projectBaseDir=/var/lib/jenkins/workspace/boot/banke-boot-bd-api

sonar.binaries=classes

sonar.java.binaries=/var/lib/jenkins/workspace/boot/banke-boot-bd-api/target/classes

 

sonar.login=admin

sonar.password=admin

 

# Java module

java-module.sonar.projectName=Java Module

# . Represents the directory specified by projectBaseDir

java-module.sonar.sources=.

java-module.sonar.projectBaseDir=src

 

Notice:

1. If 401 appears, if the account number and password are correct, the version of git is generally too low. It is best to install version 2 or higher

2. If the connection fails, it is generally the git configuration error of the jenkins configuration

 

 

3. There is a problem when packaging, and the corresponding dependency package directory cannot be found.

 

Because the local warehouse address is in the jenkins directory by default, and the warehouse address configured in my settings.xml is not the default address of jenkins. So I didn't find it when looking for the dependent package. (I haven't found the corresponding method of setting Maven's local warehouse address in Jenkins for the time being)

 

Modify Maven private service here

4. No SonarServer instance found

set in system settings

5. Can't find the SonarQube Scanner scan

 

 

6. The specified corresponding scan directory cannot be found

I don't know why it is scanned into the general directory under the current project. Set the corresponding directory

7. No certification

 

Configure login account and password

8. No binaries found

The binary file needs to set the full path

 

 

Multi-module construction of parent-child structure:

root node configuration information

 

Use the following to replace the above configuration without setting a specific directory. Find directly through the parent node

The respective properties files are placed in their respective directories

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325358166&siteId=291194637