Jenkins installation and mail configuration details

Jenkins is a Java developed, open source and very easy to use continuous integration tool. It can help us realize the work of automatic deployment environment, testing, packaging, etc. it can also send us an email notification after the success or failure of the construction task.

What is continuous integration? It is to run a task repeatedly and persistently.

Jenkins download and installation

Jenkins' download address is https://jenkins.io/download/ , when downloading, you can select each version and the corresponding operating system version. Generally, you can download the general version when downloading War file. This can run on any operating system, but only if you install JDK, because Jenkins is developed in Java.

The Jenkins version used in this blog is 2.17 and the JDK version is 1.7. If you download the latest Jenkins version on the official website, you need a 1.8 JDK, otherwise you may fail to start Jenkins.

The picture below is on Jenkins's official website Screenshot of war file.

After downloading, it is easy to start Jenkins. On the command line, enter the directory where Jenkins is located, and then execute Java - jar Jenkins War can be started. This method works well under Linux, MAC and windows.

After startup, look at the log in the command line, and finally display Jenkins is fully up and running. Jenkins is started successfully.

The following is a screenshot of startup

Screenshot of successful startup

So far, Jenkins has been successfully installed.

Access Jenkins, Jenkins configuration

The default port number of Jenkins started in that way is 8080. If you access Jenkins, your IP is 8080, and mine is started locally, so I use localhost: 8080. If you deploy on your server, you need to write your server IP to access it~

When you open Jenkins for the first time, it will let you unlock it and enter the admin initialization password. This password is prompted on the page. Under a directory on Disk C, go to Disk C to find it, open it with txt, copy it and fill it in, as shown in the following figure:

After filling in the initial password, you will be asked to choose the plug-ins, whether to choose the plug-ins recommended to be installed or custom plug-ins. We can choose to install the plug-ins recommended to be installed. If we need anything else, it will automatically install these plug-ins. The process of installing plug-ins may take a long time. Be patient, as shown in the following figure:

The following is the installation plug-in page

After the plug-in is installed, you should enter an administrator's user name, password and email. Remember here. This should be used for login in the future. The email can't be scribbled. You should write the email you use to send email in the future, otherwise email will fail.

So far, the installation and basic configuration of Jenkins are really over. Here's what it looks like to log in

Jenkins configuring mail delivery

Log in with the admin user and find the global settings in the Jenkins system management. In the global settings, there is the Jenkins location. Below, there is the email address of the system administrator. Write this as the email address entered when creating the admin user just now.

Then continue to look down, find the email notification, and then click the advanced under the email notification. This is the place to configure email.

The SMTP server is the address of the SMTP server. You can write the SMTP server of which mailbox you use

To check the use of SMTP authentication, enter the account password of the mailbox here. Note that the authorization code must be entered for QQ mailbox and 163 mailbox. You can't use the password directly, but also open SMTP in the settings.

If the mailbox is SSL protocol, you should check the SSL protocol. For example, QQ mailbox is SSL protocol

There is also an SMTP port number below. Don't write it. Jenkins will automatically write it for you. If your mailbox server port number is not the default, the default port number of SMTP is 25 and the default port number of smtpssl is 465. If your company's mail server is built by yourself, you have to write it here if the port number is changed.

Here is a screenshot

After the mail configuration is completed, let's test whether it can succeed.

Continue to search. There is a test configuration by sending a test email. Check it. It will let you enter an email, and then click test configuration to test. You can see that I have received the test email sent by Jenkins below.

The following is a screenshot of the received email.

Finally OK, Jenkins' installation, basic configuration and mail configuration are like this. Go and have a try.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>