Location>code7788 >text

Centos7 under the installation and configuration of the latest version of Jenkins (2.452.3)

Popularity:649 ℃/2024-07-24 17:17:29

1. Basic environment configuration

1.1 Server download Jenkins installation package

Download Address:/download/

Download command: wget/war-stable/2.452.3/

1.2 Server Installation and Configuration JDK

Jenkins is based on the Java language and therefore requires a Java runtime environment.

Before installing the JDK be sure to look at the currentTo install the JDK version that the Jenkins version depends onOtherwise, starting Jenkins will report an error.

The server downloads the JDK17 package and downloads the command:wget /java/17/latest/jdk-17_linux-x64_bin.

Server configuration JDK 17:

vi /etc/profile   // Modify the /etc/profile file to add the JDK environment configuration.
export JAVA_HOME=/opt/jdk-17.0.12
export PATH=$JAVA_HOME/bin:$PATH

Execute the source /etc/profile command to put the configuration into effect.

Check the server Java operating environment.

1.3 Server Installation and Configuration Tomcat

Use a Tomcat server to run Jenkins.

Download the Tomcat installation package. download command:wget /dist/tomcat/tomcat-8/v8.5.45/bin/apache-tomcat-8.5.

Extract the tomcat installation package and copy the Jenkins installation package to the Tomcat webapps directory.

tar -zxvf apache-tomcat-8.5.
cd apache-tomcat-8.5.45
cp ../ webapps/

Start the Tomcat service.

./bin/

2, Jenkins configuration and functionality of the core features introduced

2.1 Accessing and configuring Jenkins

(1) Access to Jenkins:http://server (computer)Ipaddress:8080/jenkins/

According to the page prompt, the administrator password is set in [/root/.jenkins/secrets/initialAdminPassword], use the cat command to view it:

[root@master153 ~]# cat /root/.jenkins/secrets/initialAdminPassword
c3c97414537549c7a169277bbe25b3fd

(2) Paste the password on the page to unlock Jenkins and go to the plugin configuration page:

The version of Jenkins is displayed in the lower left corner. Here it is recommended to directly select [Install recommended plug-ins]. If the version is lower, poor network, or do not want to install for the time being, you can also click on the [Select plug-ins to install] to enter the plug-in selection page:

On the left is the classification of plug-ins, there are [Organization and Administration (Organization and Administration)], [Build Tools (Build Tools)], [Language (Languages)] and so on.
The main thing here is that there is the option [None], if you want to skip the plug-in installation, you can click [None] in order to set up not to install any plug-in, and directly tap [Install] to skip this step.
Tap the back button here to install the recommended plugin, each green tick indicates that the plugin was installed successfully:

(3) Create the first administrator user
Each setting can be customized, and you can click [Save and Finish] once you've entered it.

(4) Instance Configuration
The main thing is to configure the URL, there is no special requirements, the default configuration [server ip]: 8080, after inputting you can click [Save and Finish].

Above, Jenkins has been installed.

Jenkins home page:

2.2 Introduction to Jenkins Core Functions

1. Brief analysis of warnings

Having just installed Jenkins, the most noticeable thing is probably the yellow and red warning in the upper right corner.
1.1 The yellow warning here generally indicates that a new version of Jenkins is available, and this environment indicates that this Jenkins environment has stopped supporting the current operating system, and it is recommended that it be replaced with a supported operating system.

1.2 The red warning here, which is indicative of a security problem, is also the operating system cause here.

Adhering to the principle of "if you can use it and don't understand it, don't move it", the above warnings should be ignored unless you really need to solve a certain problem.

Jenkins main features

2.1 System Configuration - System

Here are some system settings for Jenkins itself, briefly described below:

  • The main directory /root/.jenkins: is where the Jenkins configuration is stored, deleting it will clean up the current Jenkins and all its configurations.
  • System Messages: Messages can be sent to other users sharing Jenkins.
  • Number of Executors: Set how many tasks Jenkins can execute at a time, a larger number means more tasks can be executed, but the pressure on CPU and memory is also larger, which may lead to crash.
  • Jenkins URL: Jenkins address
  • System administrator e-mail address: the administrator's e-mail address used to receive messages.
  • Resource Root URL: the resource root directory
  • Environment variables: environment variable settings
  • GitHub: Github Configuration
  • Git plugin: Git plugin configuration
  • Shell: Shell Configuration

2.2 System Configuration--Tools (Global Tool Configuration)
Common or Installed Plugin Configuration Locations

  • Maven
  • JDK
  • Git installations
  • Gradle
  • Ant
  • Maven

2.3 System Configuration--Plugins (Plugin Management)
Here you can install or update the required plugins.

2.4 Security - Security (configuring global security)

Here you can configure authorization, proxies, cross domains, and more.

2.5 Security - Credentials
Here you can manage user credentials information, such as Git account passwords.

2.6 Security -- Users (managing users)
All Jenkins users can be managed here.

2.7 Status Information - System Log

All system logs can be viewed here.

Reference:/