The simplest installation method of Jenkins two - jenkins configuration

jenkins configuration

I. Overview:

Jenkins 配置其实主要是根据对应插件来的,这里我分为基础配置,和插件配置只是举例几个常用的!

1. Basic configuration:

1. jdk and maven

jdk download address:

http://www.oracle.com/technetwork/java/javase/downloads/index.html

Maven download address:

http://maven.apache.org/download.cgi

Upload the tar package of JDK and Maven to the server (container data volume directory)

cd /usr/local/docker/jenkins/data

Unzip:

tar -tzvf apache-maven-3.6.3-bin.tar.gz

Since /var/jenkins_home in the container is mounted to /jenkins/data in the local server, all your upload operations in the data directory are equivalent to the /var/jenkins_home directory in the container.
image

docker exec -it jenkins /bin/bash

image

After decompression, enter Jenkins to configure: System Management—>Global Tool Management
image
jdk installation configuration
image
maven installation configuration
image
configuration localization (display Chinese)
install Locale plug-in
image

2. git

  1. Configure Jenkins's GitLab SSH password-free login
    ● Interactively enter the Jenkins container
docker exec -it jenkins /bin/bash

● Generate SSH KEY

ssh-keygen -t rsa -C "[email protected]"

● View public key

cat /var/jenkins_home/.ssh/id_rsa.pub

● Copy the public key to GitLab
image

● Manually clone the project once, the main function of this step is to generate verification information with the server
image

● View the file just generated
image

Two plug-in configuration:

1. Publish Over SSH

Publish Over SSH is a necessary plug-in for Jenkins, because we usually Jenkins is a separate server, and the project is deployed on another server.
image

Remote Directory: It is the receiving path of the project server. Make sure to have this directory. For the rest, just write the server address, account and password as shown in the figure!
image
Test whether the connection is successful!

2. Message sending configuration

Generally, information will be notified when the project is built. The commonly used ones in China are corporate WeChat and DingTalk.
Download plug
-in:
DingTalk ’s plug-in: DingTalk

Enterprise
Wechat plug-in: Qy Wechat Notification

Dingding case:
ps: There is an operation change for the Jenkins version here. For the Jenkins version before, add the corresponding configuration in the post-build operation of the project after the plug-in is downloaded!
I use the new version, so the configuration is in the configuration center! However, it cannot be seen in the created maven project! To create a free-style project see the configuration!
application

  1. Create nail group-nail machine
  2. Jenkins configuration center configuration
    image
    Remember to test after filling out, if there is information to send, it means that it is successful!

Guess you like

Origin blog.csdn.net/javaee59406/article/details/114444522